Multiple API Calls on Initial Load with Lazy Loading and Virtual Scrolling in PrimeNG 16.3 #16612
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
While using the lazy loading and virtual scrolling features of PrimeNG's p-table, I am encountering an issue where multiple API calls are triggered during the initial load without user interaction (i.e., without any scrolling). I expected a single API call to fetch the first set of data, but the API is being called multiple times initially, which seems unnecessary.
The behaviour is observed when using the new p-scroller class introduced in PrimeNG 16.3, which seems to handle virtual scrolling differently compared to other versions.
Environment
Environment:
PrimeNG Version: 16.3.1
Angular Version: 16.2.0
Reproducer
No response
Angular version
16.2.0
PrimeNG version
16.3.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.17.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
API should only be called once during the initial load to fetch the first set of data.
As the user scrolls, the onLazyLoad event should trigger additional API calls to fetch other set of data.
The text was updated successfully, but these errors were encountered: