Skip to content

Commit

Permalink
fix(cdk/table): run differ for all columns (#30012)
Browse files Browse the repository at this point in the history
* fix(cdk/table): run differ for all columns

* fix(cdk/table): include comment

---------

Co-authored-by: Andrew Seguin <andrewseguin@google.com>
(cherry picked from commit f1c4173)
  • Loading branch information
andrewseguin authored and Andrew Seguin committed Nov 14, 2024
1 parent 86120f1 commit 3bd89ec
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,12 @@ export class CdkTable<T>
* re-render that section.
*/
private _renderUpdatedColumns(): boolean {
const columnsDiffReducer = (acc: boolean, def: BaseRowDef) => acc || !!def.getColumnsDiff();
const columnsDiffReducer = (acc: boolean, def: BaseRowDef) => {
// The differ should be run for every column, even if `acc` is already
// true (see #29922)
const diff = !!def.getColumnsDiff();
return acc || diff;
};

// Force re-render data rows if the list of column definitions have changed.
const dataColumnsChanged = this._rowDefs.reduce(columnsDiffReducer, false);
Expand Down

0 comments on commit 3bd89ec

Please sign in to comment.