Skip to content

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

Closed

Description

@rbogdy

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

Activity

  1. added
    P3
    on Jan 9, 2019
  2. rbogdy commented on Feb 19, 2019

    @rbogdy
    Author

    any news regarding this problem?

  3. added
    animation
    on Feb 19, 2019
  4. removed their assignment
    on Feb 19, 2019
  5. cmdickson commented on Mar 30, 2019

    @cmdickson

    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

  6. simeyla commented on Apr 19, 2019

    @simeyla

    @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.

  7. ghinton commented on Aug 14, 2019

    @ghinton

    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!

  8. ghinton commented on Aug 14, 2019

    @ghinton

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

  9. lubos-bistak commented on Nov 8, 2019

    @lubos-bistak

    Any news or progress on this issue?

  10. self-assigned this
    on Dec 5, 2024
  11. added 2 commits that reference this issue on Dec 5, 2024
    bcfd6c3
    b35c757
  12. added 2 commits that reference this issue on Dec 5, 2024
    7b64c45
    aafa151
  13. 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.

  14. 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

P3animationarea: material/expansion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions