angular / angular/components

bug(mat-tab): tab group dynamic does not allow to select first tab if newly created

Aperta
#24,445 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/tabs P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When i add a new tab dynamically from a button, if i choose to set the new tab as first item in the tab list and want it to select this tab, it does nothing.
I have to first select a new tab and then repeat it to make it works.

### Reproduction

https://stackblitz.com/edit/angular-qhbfy8?file=app/tab-group-dynamic-example.ts
Steps to reproduce:
1. Select checkbox : "Select tab after adding"
2. Click btn "Add new tab"

### Expected Behavior

It should select first tab

### Actual Behavior

it does not change the current tab

### Environment

- Angular: 13
- CDK/Material: 13
- Browser(s): Chrome

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il problema usando lo StackBlitz collegato, iniziando da app/tab-group-dynamic-example.ts e dai passaggi per inserire una scheda all’inizio. Traccia il modo in cui il gruppo dinamico di schede mat-tab gestisce la selezione della prima scheda appena inserita. Il lavoro è completato quando selezionare la casella di controllo e fare clic su “Add new tab” seleziona immediatamente la prima scheda.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.