Skip to content

bug(Table): filteredData of MatTableDataSource is not filled instantly on data change #21984

Closed
@o-serhiichyk

Description

@o-serhiichyk

Reproduction

Steps to reproduce:

  1. Use Material 11.1.0 or above (up to 11.2.1).
  2. Create table with *ngIf that checks 'filteredData' property of table's MatTableDataSource.
  3. Clear 'data' property of MatTableDataSource.
  4. Set some 'data' to MatTableDataSource.

https://stackblitz.com/edit/components-issue-rgcbps?file=src/app/example-component.ts

Expected Behavior

Table is hidden and then displayed again.

Actual Behavior

Table is hidden and can not be displayed.

P.S. Everything works fine with Material 11.0.4 and below.

Environment

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

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tablehelp wantedThe team would appreciate a PR from the community to address this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions