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

Abierto
#944 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@lukasmatta ya está trabajando en esto.

Desde el 5/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
9
Forks
8
Merge medio
1 d 1 h
PR fusionados (30 d)
23

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AbsaOSS/cps-shared-ui

Todos los issues de AbsaOSS/cps-shared-ui

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.