Skip to content

Commit

Permalink
Fix header rerender bug which occurs when a table has two header rows…
Browse files Browse the repository at this point in the history
… updated simultaneously.

This is a proposed solution to https://github.com/angular/angular/issues/58347.
  • Loading branch information
anthonyrgreen authored Oct 24, 2024
1 parent bb7563a commit 94d4f13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cdk/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,10 @@ 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) => {
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 94d4f13

Please sign in to comment.