Skip to content

mat-expansion-panel re-renders multiple times in a very simple case (no animation, OnPush). #14952

Closed

Description

@mfursov

What is the expected behavior?

mat-expansion-panel updates (renders) exactly once when there is no reason to do it multiple times.

What is the current behavior?

mat-expansion-panel renders at least 2 times ([@.disabled]="true"+ ChangeDetectionStrategy.OnPush)
or even more times if animation is enabled (default) and change detection mode is Default.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-rj4nhe?file=app%2Fexpansion-overview-example.ts

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

7.2.1, Chrome 71

Is there anything else we should know?

It is very important not to have "unexpected" behavior (multiple rendering) because it affects performance metrics. If multiple rendering is "expected" I would suggest to mention about it in docs.

Activity

  1. added
    P3
    perf
    on Feb 19, 2019
  2. josephperrott commented on Feb 19, 2019

    @josephperrott
    Member

    It looks like the expansion panel does not rerender entirely multiple times, though change detection seems to be run multiple times unnecessarily.

  3. removed their assignment
    on Feb 19, 2019
  4. snibbo commented on Jan 15, 2024

    @snibbo

    Is there any workaround? My panel is jumping up and down :(

  5. self-assigned this
    on Dec 5, 2024
  6. added 2 commits that reference this issue on Dec 5, 2024
    bcfd6c3
    b35c757
  7. added 2 commits that reference this issue on Dec 5, 2024
    7b64c45
    aafa151
  8. angular-automatic-lock-bot commented on Jan 5, 2025

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  9. locked and limited conversation to collaborators on Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: material/expansionperf

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions