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

Aperta
#944 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@lukasmatta ci sta già lavorando.

Dal 5/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
TypeScript
Stelle
9
Fork
8
Merge medio
1g 1h
PR unite (30g)
23

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AbsaOSS/cps-shared-ui

Tutte le issue di AbsaOSS/cps-shared-ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.