bug(CdkTable): Table rows are re-rendered twice when columns change #25307
Labels
area: cdk/table
P4
A relatively minor issue that is not relevant to core functions
perf
This issue is related to performance
Is this a regression?
The previous version in which this bug was not present was
No response
Description
A component with a MatTable has two
*matRowDef
directives, one with awhen
clause and a default one. When changing the list of columns after the initial render all rows will be recreated and correctly updated.However, on the next change detection cycle the rows will be re-rendered again even if nothing has changed.
Reproduction
Steps to reproduce:
https://stackblitz.com/edit/components-issue-2dlnew?file=src/app/example-component.ts
Expected Behavior
The rows should be re-rendered once, after the columns array has changed.
Actual Behavior
The rows are re-rendered twice, once after the columns array has changed and a second time on the next change detection cycle.
Environment
The Stackblitz repro uses v13 (provided by the issue template) but it can be reproduced with the latest version too.
The text was updated successfully, but these errors were encountered: