Skip to content

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

Open
@mik01aj

Description

@mik01aj

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

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 (?): #8287

Metadata

Metadata

Assignees

No one assigned

    Labels

    GThis is is related to a Google internal issueP2The issue is important to a large percentage of users, with a workaroundarea: material/expansion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions