Skip to content

Expansion Panel - Header height animation jump when inside navigation tabs #14759

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

Closed
rbogdy opened this issue Jan 8, 2019 · 7 comments · Fixed by #30119
Closed

Expansion Panel - Header height animation jump when inside navigation tabs #14759

rbogdy opened this issue Jan 8, 2019 · 7 comments · Fixed by #30119
Assignees
Labels
animation This issue is related to Angular animations or CSS animations area: material/expansion P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@rbogdy
Copy link

rbogdy commented Jan 8, 2019

What is the expected behavior?

The height to be rendered directly with the set values and not 'jump' to the new value from the 'default hard coded' ones

What is the current behavior?

The mat-expansion-panel-header height will jump to the newly set value (even when using the new MAT_EXPANSION_PANEL_DEFAULT_OPTIONS injection token) resulting in ugly visuals. This is very evident when switching between tabs for example

What are the steps to reproduce?

https://stackblitz.com/edit/angular-e2of2s

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

Angular: 7.2.0
Material: 7.2.1
Browser: Chrome or Mozilla@latests

Is there anything else we should know?

In the StackBlitz example if you change the 'collapsedHeight' and 'expandedHeight' to the default value of '48px' they will not 'jump' anymore

@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jan 9, 2019
@rbogdy
Copy link
Author

rbogdy commented Feb 19, 2019

any news regarding this problem?

@josephperrott josephperrott added the animation This issue is related to Angular animations or CSS animations label Feb 19, 2019
@josephperrott josephperrott removed their assignment Feb 19, 2019
@cmdickson
Copy link

I was having this same problem and found that disabling animation for the panel header addressed the issue. I just made the change in your Stackblitz example and it seemed to work there as well:

<mat-expansion-panel-header [@.disabled]="true" expandedHeight="60px" collapsedHeight="60px">
        This is the expansion 3 title
</mat-expansion-panel-header>

So, as long as the desired behaviour is static header height, this workaround should work

@simeyla
Copy link

simeyla commented Apr 19, 2019

@cmdickson Phew! This was driving me nuts. Thanks for pointing out that you can do this just on the header - so as to retain expand and contract animations for the panels' contents.

@ghinton
Copy link

ghinton commented Aug 14, 2019

Anyone noticed that if you set [@.disabled]="true" when the expansion panel is within a tab, if you navigate to another tab and then back to the one with the expansion panel in, the animations are re-enabled? Driving me nuts!

@ghinton
Copy link

ghinton commented Aug 14, 2019

Looking at the markup, it appears that the ng-animate-disabled class is removed when you switch tabs

@lubos-bistak
Copy link

Any news or progress on this issue?

@crisbeto crisbeto self-assigned this Dec 5, 2024
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 5, 2024
Reworks the expansion panel to animate purely with CSS, rather than going through the `@angular/animations` module. This simplifies the setup and allows us to resolve several long-standing bug reports.

Fixes angular#27946.
Fixes angular#22715.
Fixes angular#21434.
Fixes angular#20610.
Fixes angular#20517.
Fixes angular#17177.
Fixes angular#16534.
Fixes angular#16503.
Fixes angular#14952.
Fixes angular#14759.
Fixes angular#14075.
Fixes angular#11765.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 5, 2024
Reworks the expansion panel to animate purely with CSS, rather than going through the `@angular/animations` module. This simplifies the setup and allows us to resolve several long-standing bug reports.

Fixes angular#27946.
Fixes angular#22715.
Fixes angular#21434.
Fixes angular#20517.
Fixes angular#17177.
Fixes angular#16534.
Fixes angular#16503.
Fixes angular#14952.
Fixes angular#14759.
Fixes angular#14075.
Fixes angular#11765.
crisbeto added a commit that referenced this issue Dec 5, 2024
Reworks the expansion panel to animate purely with CSS, rather than going through the `@angular/animations` module. This simplifies the setup and allows us to resolve several long-standing bug reports.

Fixes #27946.
Fixes #22715.
Fixes #21434.
Fixes #20517.
Fixes #17177.
Fixes #16534.
Fixes #16503.
Fixes #14952.
Fixes #14759.
Fixes #14075.
Fixes #11765.

(cherry picked from commit aafa151)
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
animation This issue is related to Angular animations or CSS animations area: material/expansion P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants