Skip to content

bug(mat-table): *matNoDataRow not displayed when data is empty #19992

@mrmokwa

Description

@mrmokwa

Reproduction

https://stackblitz.com/edit/components-issue-uj7g1k

Steps to reproduce:

  1. Notice that no message is displayed when array is empty.
    image

  2. Uncomment the data in ELEMENT_DATA array, and apply "abc" to the filter, now a message from matNoDataRow is displayed
    image

Expected Behavior

What behavior were you expecting to see?
When data is an empty array, it should display the matNoDataRow

Actual Behavior

It only shows matNoDataRow if the data has at least one value before applying the filter.

Environment

  • Angular: 10.0.3
  • CDK/Material: 10.0.2
  • Browser(s): Chrome
  • Operating System Windows

Metadata

Metadata

Assignees

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