angular / angular/components

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

Aperta
#20,680 12 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/expansion G P2
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia riproducendo il comportamento della demo di mat-expansion-panel mostrata nell’issue, con diversi pannelli compressi e uno espanso. Traccia l’implementazione di mat-expansion-panel e il comportamento della relativa animazione; il lavoro è completato quando i contenuti dei pannelli compressi vengono rimossi dal DOM senza interrompere le transizioni.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.