angular / angular/components

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

Abierto
#20,680 12 comentarios 0 reacciones 0 asignados Ver en GitHub
area: material/expansion G P2
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza reproduciendo el comportamiento de la demo de mat-expansion-panel mostrada en el issue, con varios paneles contraídos y uno expandido. Rastrea la implementación de mat-expansion-panel y el comportamiento de su animación; se considera terminado cuando el contenido de los paneles contraídos se elimina del DOM sin interrumpir las transiciones.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.