[Paginator] When Updated length is "shorter" than the pageIndex (*pageSize), pageIndex should be updated and then a pageEvent to the pageIndex emited
- Ngôn ngữ chính
- TypeScript
- Star
- 25k
- Fork
- 6.8k
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 91
Mô tả
#### What is the expected behavior?
When I am on the last Page of a dataSet and then delete the elements that are currently showing (or filter elements "away"), and thereby change the length property, the paginator should update the pageIndex to the ACTUAL lastPage and then _emitPageEvent() there.
#### What is the current behavior?
When I am on the last Page of a table and then delete the element(s) that are currently showing, the paginator will simply show a empty table with a label like "91 - 100 of 90".
Also: I am using an Array as Datasource for my Table.
#### What are the steps to reproduce?
The example in the Documentations shows the behavior very well (but if necessary I can still provide the stackblitz with a table)
https://material.angular.io/components/paginator/examples
Steps
#1 Click 9x on the "nextPage" Button until you are on the last Page (91-100 of 100)
#2 Click on the input "List length" and enter "90"
-> The paginator shows "91-100 of 90" INSTEAD should show "81-90 of 90" and a PageEvent fired to the last Page
#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I had the problem with Material+Material 6, but apparently it shows as well on 7
Browser: Chrome
OS: Win 10
#### Is there anything else we should know?
Inside the Paginator Component: The setter function for the length property could simply test `if (Math.floor(value, this.pageSize) < this.pageIndex) { /* set pageIndex and emitPageEvent accordingly */}`
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với ví dụ paginator trong tài liệu Angular Material, tái hiện việc thay đổi độ dài của trang cuối từ 100 thành 90, sau đó kiểm tra setter length của component Paginator. Được xem là hoàn tất khi trang thay đổi từ 91–100 thành 81–90 trên tổng số 90 và một PageEvent được phát ra cho trang cuối mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- angular, typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100