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

p-table virtual scroll event is triggering even on scroll up #8812

Closed
pachu4u opened this issue May 2, 2020 · 6 comments
Closed

p-table virtual scroll event is triggering even on scroll up #8812

pachu4u opened this issue May 2, 2020 · 6 comments

Comments

@pachu4u
Copy link

pachu4u commented May 2, 2020

If you have a PrimeNG PRO Support subscription please post your issue at;

https://pro.primefaces.org

where our team will respond within 4 business hours.

If you do not have a PrimeNG PRO Support subscription, fill-in the report below. Please note that
your issue will be added to the waiting list of community issues and will be reviewed on a first-come first-serve basis, as a result, the support team is unable to guarantee a specific schedule on when it will be reviewed. Thank you for your understanding.

Current Queue Time for Review
Without PRO Support: ~8-12 weeks.
With PRO Support: 1 hour

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
Please demonstrate your case at stackblitz by using the issue template below. Issues without a test case have much less possibility to be reviewd in detail and assisted.

https://stackblitz.com/github/primefaces/primeng-issue-template

Current behavior

The virtual scroll event gets triggered even when scrolled up with lazy loading. The same can be seen in official demo of the scroll functionality.
Expected behavior

Event should be triggered only while scrolling down
Minimal reproduction of the problem with instructions
Scroll up and down on the official demo

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 5.X

angular 8.2.3

  • PrimeNG version: 5.X

latest 9.0.6

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

@pachu4u
Copy link
Author

pachu4u commented May 2, 2020

I also tried a work around like this. Unfortunately with this the loading-body /loading text doesn't disappear. Does it expect the total records to be increased every time the function is called?

loadDataOnScroll(event: LazyLoadEvent) { console.log(event); if(this.scrollOffset < event.first) { this.scrollOffset = event.first; this.getNextPage(); } }

I see no use of setting this.loading to true or false.

@cagataycivici
Copy link
Member

VirtualScrolling for Table is reimplemented from the ground up (#8855) and this particular case i no longer an issue with the new implementation. Thank you for the feedback.

@brayanL
Copy link

brayanL commented Nov 29, 2022

Hello guys, this is still present in the latest version, even in your demo:
https://www.primefaces.org/primeng/table/virtualscroll
How can I remove the scroll-up with lazy loading? Thanks.

@mertsincan
Copy link
Member

Hi, you can use appendOnly:true option in virtualScrollerOptions property or you need to write a cache algorithm yourself in lazy method.
https://www.primefaces.org/primeng/scroller

@brayanL
Copy link

brayanL commented Nov 30, 2022

@mertsincan thanks for your reply but that property is not present in virtualScrollerOptions:

export interface ScrollerOptions { id?: string | undefined; style?: any; styleClass?: string | undefined; tabindex?: number | undefined; items?: any[]; itemSize?: any; scrollHeight?: string | undefined; scrollWidth?: string | undefined; orientation?: ScrollerOrientationType; delay?: number | undefined; lazy?: boolean; disabled?: boolean; loaderDisabled?: boolean; columns?: any[] | undefined; showSpacer?: boolean; showLoader?: boolean; numToleratedItems?: any; loading?: boolean; autoSize?: boolean; trackBy?: any; onLazyLoad?: Function | undefined; onScroll?: Function | undefined; onScrollIndexChange?: Function | undefined; }

@brayanL
Copy link

brayanL commented Dec 5, 2022

The last version of primeng has that property appendOnly I was using version 14. Please update the tables on your website or provide better documentation. Thanks for your awesome work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants