mat-expansion-panel keeps contents of collapsed panels in DOM
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
I found this while debugging rendering performance in my app. I have a large section that initially renders as a big mat-expansion-panel with all panels collapsed, except one. Here is a screenshot of mat-expansion-panel demo that sxhibits the same behavior:

I believe that the contents of the collapsed sections should be removed from the DOM to not slow down the application by rendering content that isn't currently visible.
If the reason for doing that was animations, then the animations probably need fixing - Angular supports keeping things in DOM while they are animating. Or maybe this was used, but the animation end never gets registered? I'm gussing :) In any case I believe it's a bug.
CC @jelbourn
Possilbly related (?): https://github.com/angular/components/issues/8287
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par reproduire le comportement de la démo mat-expansion-panel présentée dans l’issue, avec plusieurs panneaux réduits et un panneau développé. Suivez l’implémentation de mat-expansion-panel et le comportement de son animation ; le travail est terminé lorsque le contenu des panneaux réduits est supprimé du DOM sans interrompre les transitions.
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
- 45/100