Skip to content

Paginator does not "reset" when new length is smaller than the previous shown length #5812

@Laurensvdw

Description

@Laurensvdw

Bug, feature request, or proposal:

Reset paginator when the length property has changed, or provide a method we can call to do the reset manually.

What is the expected behavior?

Going back to pageIndex 0

What is the current behavior?

Page remains the same even if the length provided is smaller than pageIndex(+1) * pageSize

What are the steps to reproduce?

Go to a page in your data which has a range greater then the length of data after filtering.
E.g. (PageSize: 10) results 20-30 are shown, then when pressing some kind of filter you only have a length of results of 4 in total. It will show something like 20-24 (while it should be 1-4, and on pageIndex: 0)
image

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

When having a use-case which is more 'complex' than paginating over a simple data set, the current paginator is not usable.

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

Latest version

Metadata

Metadata

Assignees

Labels

needs: discussionFurther discussion with the team is needed before proceeding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions