bug(mat-tab): tab group dynamic does not allow to select first tab if newly created
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### 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
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Reproduisez le problème avec le StackBlitz lié, en commençant par app/tab-group-dynamic-example.ts et les étapes pour insérer un onglet au début. Suivez la manière dont le groupe d’onglets mat-tab dynamique gère la sélection du premier onglet nouvellement inséré. C’est terminé lorsque la sélection de la case à cocher et le clic sur « Add new tab » sélectionnent immédiatement le premier onglet.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100