cps-table/tree-table: changing rows-per-page on an empty table doesn't emit

Đang mở
#944 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@lukasmatta đang làm issue này rồi.

Từ ngày 5/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

bug library

When the table has no records (totalRecords = 0), picking a new value in the "Rows per page" select does nothing outside the table. onRowsPerPageChanged() sends the change through changePage(), which returns early because getPageCount() is 0. Neither pageChanged nor lazyLoaded fires. The select still shows the new value because rows is bound with ngModel.

In lazy mode, the consumer never learns about the new page size. When data arrives later (for example after a filter change), the request uses the old rows. The paginator then shows one page size while the rows come from a request using another.

Steps to reproduce:

  • Render cps-table with [lazy]="true", [paginator]="true" and totalRecords = 0.
  • Change "Rows per page" from 10 to 25. Nothing is emitted.
  • Change a filter in the consumer so that it fetches data.
  • The consumer requests 10 rows while the select shows 25.

Expected: A change to the page size always emits pageChanged, and in lazy mode lazyLoaded, with first reset to 0, whatever the current record count is.

Suggested fix: In onRowsPerPageChanged, skip the page-count check. Call primengTable.onPageChange({ first, rows }) directly, or clamp the target page to max(pageCount - 1, 0). Add a spec covering an empty lazy table.

Ngôn ngữ chính
TypeScript
Star
9
Fork
8
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AbsaOSS/cps-shared-ui

Tất cả issue của AbsaOSS/cps-shared-ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.