Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple API Calls on Initial Load with Lazy Loading and Virtual Scrolling in PrimeNG 16.3 #16612

Open
AnkitaMali opened this issue Oct 23, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@AnkitaMali
Copy link

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.

@AnkitaMali AnkitaMali added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant