Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mfursov opened this issue Jan 25, 2019 · 2 comments
Labels
area: material/expansion P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent perf This issue is related to performance

Comments

@mfursov
Copy link

mfursov commented Jan 25, 2019

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.

@josephperrott josephperrott added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent perf This issue is related to performance labels Feb 19, 2019
@josephperrott
Copy link
Member

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

@snibbo
Copy link

snibbo commented Jan 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/expansion P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent perf This issue is related to performance
Projects
None yet
Development

No branches or pull requests

4 participants