angular / angular/components

bug(Mat-Tabs): Mat-tabs on mat-dialog not working when selectedIndex change asynchronously

Ouverte
#19,814 8 commentaires 7 réactions 0 personnes assignées Voir sur GitHub
area: material/tabs P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

#### Reproduction
https://stackblitz.com/edit/mat-tabs-on-mat-dialog-problem

Steps to reproduce:
1. Use mat-dialog for dialog
2. Use mat-tabs for multiple tabs
3. Use selectedIndex to select tabs dynamically
4. Initialize selectedIndex value
4. Change selectedIndex asynchronously


#### Expected Behavior

I will initially see the tab of the index that I initialize first. But when I change the selectedIndex, it will switch to the new tab of that index.

#### Actual Behavior

Asynchronously changed tabs contents will go blank. The tab contains blank content. But if I add 500ms with setTimeout it works. But without this setTimeout, it dosn't work

#### Environment

- Angular: 8 or 9
- CDK/Material: 8, 10
- Chrome, Firefox
- Ubuntu, Windows

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz liée et examinez l’interaction entre MatTabs et MatDialog lorsque selectedIndex change de manière asynchrone. Reproduisez le contenu vide de l’onglet sans le délai de 500ms, puis vérifiez que l’onglet sélectionné initialement et l’onglet sélectionné de manière asynchrone s’affichent tous deux correctement.

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é
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.