primefaces / primeng

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

Issue with table that has virtual scrolling and lazy loading #12547

Closed monkey-jhe closed 3 hours ago

monkey-jhe commented 1 year ago

Describe the bug

In the demo table for virtual scrolling with lazy loading the table doesn't always trigger the lazy load event properly.

Environment

.

Reproducer

https://stackblitz.com/edit/primeng-tablevirtualscroll-demo-ptfsgv?file=src/app/app.component.html

Angular version

15.1.0

PrimeNG version

15.1.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16.13.2

Browser(s)

No response

Steps to reproduce the behavior

  1. Jump to a lower part of the table (quickly drag the scrollbar) so that many virtual pages are above and below the newly loaded data
  2. Wait for the loading to finish
  3. Scroll up to trigger the lazy loading and wait for it to finish multiple times
  4. After 2-5 times of triggering the lazy loading it gets stuck loading data and doesn't trigger the lazy loading event

Expected behavior

When you jump to a lower part of the table the lazy loading event should be triggered properly every time you scroll past a certain amount of rows.

JohannesBeiserSG commented 6 months ago

I noticed the same problem. It can easily be reproduced in the official current Stackblitz example by changing scrollHeight to something like 750px.

Scrolling down fast using the scrollbar, you can see at the border of a lazy-load block of 100 that the skeleton is waiting to be filled with entries but the lazyLoadEvent only triggers for the skeleton-rows if you scroll further up (in the middle of the empty 100-element block). But thats too late.

mertsincan commented 3 hours ago

Hi,

So sorry for the delayed response! Improvements have been made to many components recently, both in terms of performance and enhancement. Therefore, this improvement may have been developed in another issue ticket without realizing it. You can check this in the documentation. If there is no improvement on this, can you reopen the issue so we can include it in our roadmap? Please don't forget to add your feedback as a comment after reopening the issue. These will be taken into account by us and will contribute to the development of this feature. Thanks a lot for your understanding!

Best Regards,