primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.44k stars 4.6k forks source link

p-table: rowsPerPageOptions set to All doesn't update the paginator consistently when changing the table's [value] #12674

Open activedecay opened 1 year ago

activedecay commented 1 year ago

Describe the bug

Changing the pagination dropdown to 'All' does not have the desired effect when the entries in the table are growing

Environment

linux browser. reproduced in stackblitz though, so all environment information should be there as well

Reproducer

https://stackblitz.com/edit/primeng-tablepage-demo-z2hxr4?file=src/app/app.component.ts

Angular version

15.1.0

PrimeNG version

15.0.1

Build / Runtime

TypeScript

Language

TypeScript

Node version (for AoT issues node --version)

v18.12.0

Browser(s)

chromium

Steps to reproduce the behavior

Steps:

  1. create a table that is being updated with new rows
  2. setup pagination with {'showAll': 'All'} and with the number of rows shown equal to the rows variable
  3. render the table in the GUI, wait for an update, then change the rows to 'All' using the dropdown menu in the gui
  4. ERROR: the behavior expected is that all the rows are shown and the numbers in the paginator make sense. the numbers don't make sense, and there are additional pages shown as an option to click on.
  5. workaround: clicking the number 1 in the paginator will show all the rows as expected

Expected behavior

updating the length of a table's value array should update the paginator as expected when the number of rows is set to 'all'

ymg2006 commented 11 months ago

Hello, I faced same issue, furthermore, debugging the primeng is a PITA with really poor documentation.