bug(mat-tab): tab group dynamic does not allow to select first tab if newly created
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
### 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
Guía de contribución
Línea de trabajo
Reproduce el problema usando el StackBlitz enlazado, comenzando con app/tab-group-dynamic-example.ts y los pasos para insertar una pestaña al principio. Rastrea cómo el grupo dinámico de pestañas mat-tab gestiona la selección de la primera pestaña recién insertada. Está terminado cuando seleccionar la casilla de verificación y hacer clic en “Add new tab” selecciona inmediatamente la primera pestaña.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100