Skip to content

bug(table): header does not update after context change #22022

Open
@TobiDimmel

Description

@TobiDimmel

Reproduction

https://stackblitz.com/edit/mat-table-column-width-issue

Maybe related to #13030

Expected Behavior

In my use case I want to display mat-table with column widths that are defined through some configuration object (context).
That configuration object can change during the component life time (in my production case through route component reuse).

I expect that mat-table gets updated when the configuration object changes.

Actual Behavior

mat-table does not get updated.
If you call this.matTable.removeHeaderRowDef(null) manually on change mat-table is updated correctly.

Environment

  • Angular: 11.2.1
  • CDK/Material: 11.2.1
  • Browser(s): Chrome, Safari, ...
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10, iOS, ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/table

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions