angular / angular/components

mat-expansion-panel keeps contents of collapsed panels in DOM

Ouverte
#20,680 12 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area: material/expansion G P2
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:

![4kunmyWShAfRwzA](https://user-images.githubusercontent.com/3027415/94566715-f24f3c00-026a-11eb-9c09-139061cd4181.png)

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

Recevez les nouvelles issues par e-mail

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