p-table virtual scroll errors when adding new rows in v9.1

UI Components for Angular
Post Reply
Posts: 2
Joined: 25 Jun 2020, 15:54

25 Jun 2020, 16:13


I'm using the latest v9.1 components in my project, and have been working on a p-table which is bound to a datasource that is expected to change while the table is displayed in a page. Whenever a new record is added to the datasource and the table updates, I'm seeing errors which look like this:

Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'height: 37910px'. Current value: 'height: 37944px'.

I have put together a sample in StackBlitz, pls view the console to see the errors:
https://stackblitz.com/edit/primeng-tab ... e-primeng9

In this simple sample the rows do actually get added and the state of the table seems to survive, however in my project's larger and more complicated implementation these errors are more disruptive and the table's scrolling breaks.

While putting that sample together, I originally forked some code from a similar sample which was based on PrimeNG version 6, and with all of my own code remaining exactly the same, these errors are *not* happening in PrimeNG 6:
https://stackblitz.com/edit/primeng-tab ... e-primeng6

I'm not sure if this is a PrimeNG issue, or perhaps an Angular issue, since the versions of both changed between these demos.

Does anyone know how I can resolve this?

Many thanks


Posts: 2
Joined: 25 Jun 2020, 15:54

29 Jun 2020, 12:51

Hi all,

I have since confirmed that this issue is definitely a regression between v9.0.6 and v9.1.0, please see sample running v9.0.6 and note the absence of the errors:

https://stackblitz.com/edit/primeng-tab ... primeng9-0

I guess the re-written virtual scrolling functionality released in v9.1.0 is the cause.

Should I formally submit this as an issue in GitHub?



Posts: 7
Joined: 04 Jul 2017, 13:05

30 Jun 2020, 18:32


this must be a more general error as only adding new records.
After updating to Angular 9.1.11 with PrimeNG 9.1.2 my large (2,600 rows) table with [virtualScroll]="true" also throws the same error (and also with 9.0.6).


Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests