I am building an app which uses live data that should update every few seconds. I am using mat-table, which displays an addition mat-table inside the collapsable row. The collapse works fine, but when I update the datasource it collapses. Is there any way to prevent/override this behaviour? I edited the collapsing example to show what I mean: https://stackblitz.com/edit/angular-3yukjz - just press the first element, it will collapse as the datasource is changed.