You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expansion panels in tabs not working properly #9834
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):
Appearance after switching tabs:
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.
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.
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.
Activity
tgmendes commentedon Feb 8, 2018
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
*ngIfand 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):
Appearance after switching tabs:

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.
tgmendes commentedon Feb 8, 2018
Thanks for the fix @trichetriche .
I also expect there will be a solution for this.
Bmahecha123 commentedon Feb 8, 2018
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.
josephperrott commentedon Feb 13, 2018
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.
josephperrott commentedon Feb 15, 2018
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.
yajneshrai commentedon May 24, 2018
I too faced this issue. A big thanks to @trichetriche for the work around! Made my life easier.
nategurian commentedon Dec 28, 2018
@trichetriche Workaround works great. Thanks! Took no time at all to implement and works as expected
coaxfiber commentedon May 6, 2019
put selectedtabchange in mat tab group

create a variable and the function

then put the ng if in accordion elements for each tab

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.
angular-automatic-lock-bot commentedon Jun 2, 2021
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.