bug(Mat-Tabs): Mat-tabs on mat-dialog not working when selectedIndex change asynchronously
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
#### 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
Beitragsleitfaden
Rechercherichtung
Beginne mit der verknüpften StackBlitz-Reproduktion und untersuche das Zusammenspiel zwischen MatTabs und MatDialog, wenn sich selectedIndex asynchron ändert. Reproduziere den leeren Tab-Inhalt ohne die Verzögerung von 500ms und überprüfe anschließend, dass sowohl der anfänglich ausgewählte Tab als auch der asynchron ausgewählte Tab korrekt gerendert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100