From 3bd89ecd5a89d830652b38d7841dbb8f33057a59 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Thu, 14 Nov 2024 13:12:36 -0700 Subject: [PATCH] fix(cdk/table): run differ for all columns (#30012) * fix(cdk/table): run differ for all columns * fix(cdk/table): include comment --------- Co-authored-by: Andrew Seguin (cherry picked from commit f1c417353964c6bb7f22cee4376595931615de5d) --- src/cdk/table/table.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cdk/table/table.ts b/src/cdk/table/table.ts index 3da535033a2a..73c8139e53a6 100644 --- a/src/cdk/table/table.ts +++ b/src/cdk/table/table.ts @@ -1094,7 +1094,12 @@ export class CdkTable * 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);