components icon indicating copy to clipboard operation
components copied to clipboard

When filter applied on last page, MatTable doesn't display any rows. But it displays correctly when filter applied on first page.

Open kamalSaiDd opened this issue 8 years ago • 4 comments

Bug, feature request, or proposal:

When filter applied on last page, MatTable doesn't display any rows. But it displays correctly when filter applied on first page.

What is the expected behavior?

When filter applied on last page,MatTable should display rows which are available.

What is the current behavior?

When filter applied on last page, Table doesn't display any rows.

What are the steps to reproduce?

StackBlitz: https://stackblitz.com/edit/angular-material2-issue-oyejx1

What is the use-case or motivation for changing an existing behavior?

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular6.4.1, TypeScript - ~3.1.1.

Is there anything else we should know?

Please find screenshot for referrence:

image

kamalSaiDd avatar Nov 19 '18 23:11 kamalSaiDd

Hi..

Any update on this issue ?

kamalSaiDd avatar Nov 26 '18 19:11 kamalSaiDd

The issue you are seeing is that the paginator does not automatically go to the first page of results when you filter. To fix this, add this.paginator.firstPage(); to your applyFilter function.

https://stackblitz.com/edit/angular-material2-issue-qhhaav?file=app/app.component.ts

andrewseguin avatar Dec 10 '18 23:12 andrewseguin

The issue you are seeing is that the paginator does not automatically go to the first page of results when you filter. To fix this, add this.paginator.firstPage(); to your applyFilter function.

https://stackblitz.com/edit/angular-material2-issue-qhhaav?file=app/app.component.ts

Awesome. Thank you much.

kamalSaiDd avatar Dec 10 '18 23:12 kamalSaiDd

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.