bug([mat-table]): mat-tab-group messes up expandable rows in table
See original GitHub issueReproduction
Stackblitz project: https://stackblitz.com/edit/github-itepdn To see the bug, just open the app, switch to the second tab and go back to the first one. The bug only shows with enabled Ivy compiler.
Expected Behavior
Switching tabs in mat-tab-group shouldn’t affect the expanded rows in the table.
Actual Behavior
All rows in the table are expanded after switching to the second tab and back. This shouldn’t be possible as normally the table allows only for one expanded row at a time.
Environment
- Angular: 9.1.0
- CDK/Material: 9.2.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows and Ubuntu
- Enabled Ivy
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
mat-tab-group messes up expandable rows in table ... - GitHub
The bug only shows with enabled Ivy compiler. Expected Behavior Switching tabs in mat-tab-group shouldn't affect the expanded rows in the table.
Read more >Expandable row in material table , all rows expanded when ...
I wanted to keep the behaviour I have, I just wanted to remove the bug of expanding rows whenever I click another tab.....
Read more >A Table with Expandable and Collapsible Rows Using Angular
In this article, I will walk you through how I created a table in Angular that has expandable and collapsible rows. My motivation...
Read more >Table Creator | Figma Community
Create custom-styled tables which can be easily resized, edited and automatically adjust to content. Control the design of your tables by modifying the ......
Read more >Tabs - Angular Material
Angular Material tabs organize content into separate views where only one view can be visible at a time. Each tab's label is shown...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is an issue related to how Angular handles animations. To resolve this, you can lazily load your tab content as a workaround.
https://stackblitz.com/edit/github-itepdn-3sq67o?file=src/app/app.component.html
I face the same issue. Manually disabling Ivy in tsconfig.json helps, but obviously thats not a solution.