Skip to content

Expansion panels in tabs not working properly #9834

Closed

Description

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When I switch between tabs that both have expansion panels, I want the expansion panels to behave like they would in any other situation.

What is the current behavior?

The panels are sort of opened, and their style is messed up :

image

What are the steps to reproduce?

Stackblitz

Is there anything else we should know?

Unlike #5269 there's no hidden tab. So I think it isn't a duplicate, hence the new issue.

Activity

  1. tgmendes commented on Feb 8, 2018

    @tgmendes

    I have exactly the same problem as you do, and I also have looked at #5269 . The solutions there do apply to our case (you wrap the accordion/expansion panel with an *ngIf and only show if the tab is selected).

    This did not work for me.

    Here are some screenshots that may help:
    Expected behavior (without tab switching):
    image

    Appearance after switching tabs:
    image

    I did not click anywhere in the expansion panels before switching tabs.

    Hope this helps in figuring out the problem, as I am also facing this issue.

  2. tgmendes commented on Feb 8, 2018

    @tgmendes

    Thanks for the fix @trichetriche .

    I also expect there will be a solution for this.

  3. Bmahecha123 commented on Feb 8, 2018

    @Bmahecha123

    The only issue I'm finding with this workaround is that the screen will scroll up to line up with the expanded content when you switch tabs. This happens when the tab container is the only element on the x axis.

  4. josephperrott commented on Feb 13, 2018

    @josephperrott
    Member

    With the submission of #8921, you should now be able to lazy load the content of the tabs. With the content of the tabs being lazy loaded, the animations move to the correct state as desired.

  5. josephperrott commented on Feb 15, 2018

    @josephperrott
    Member

    At this point this is the only viable solution we have found as this is actually an issue of animations failing to trigger.

    We hope to be able to determine a better solution in the future, but at this point this is the best solution we have found.

  6. yajneshrai commented on May 24, 2018

    @yajneshrai

    I too faced this issue. A big thanks to @trichetriche for the work around! Made my life easier.

  7. nategurian commented on Dec 28, 2018

    @nategurian

    @trichetriche Workaround works great. Thanks! Took no time at all to implement and works as expected

  8. coaxfiber commented on May 6, 2019

    @coaxfiber

    put selectedtabchange in mat tab group
    image

    create a variable and the function
    image

    then put the ng if in accordion elements for each tab
    image

    the first tab is equal to 0
    the second tab is equal to 1 and so on

    this hides all the accordion element and shows only the accordions corresponding to the tab index.

  9. angular-automatic-lock-bot commented on Jun 2, 2021

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

  10. locked and limited conversation to collaborators on Jun 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions