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-scroller] - Lazy loading + delay lead to infinite loading #16263

Open
MaewenPelletier opened this issue Aug 20, 2024 · 3 comments
Open

[p-scroller] - Lazy loading + delay lead to infinite loading #16263

MaewenPelletier opened this issue Aug 20, 2024 · 3 comments
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Milestone

Comments

@MaewenPelletier
Copy link

Describe the bug

Can be reproduce on the demo page of p-scroller https://primeng.org/scroller#lazy-load

Go on the lazy list, scroll down then scroll up to the previous location before the call resolve (the delay parameter 250 in the example)

You are stuck in a infinite loading :

image

Environment

Bug is present on local (16.9.1) and in the stackblitz provided on the primeng doc aswell ( "primeng": "17.18.9")

Reproducer

https://stackblitz.com/edit/b43ssr-rbmhom?file=package.json

Angular version

17

PrimeNG version

17

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

16

Browser(s)

No response

Steps to reproduce the behavior

cf introduction

Expected behavior

It should not display the loader but the data

@MaewenPelletier MaewenPelletier added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 20, 2024
@SPKorhonen
Copy link
Contributor

I think I've encountered the same problem in 17.18.x

I think I've isolated the problem into onScrollPositionChange.

  • When it is called for the first time the target.scrollTop gives a reasonable value.
  • However, if delay is enabled it is called a second time from inside of this.scrollTimeout via this.onScrollChange.
  • In this invocation target always returns target.scrollTop == 0 which causes all kinds of problems
  • Unfortunately, I haven't found a definitive reason for the behaviour
  • If I disable the delay scroller works.
  • I've also tried caching the result of first invocation and using it in this.onScrollChange which also works

@MaewenPelletier
Copy link
Author

MaewenPelletier commented Oct 8, 2024

@SPKorhonen thansk for the informations !

Maybe completely unrelated but I experienced weird behavior using delay or async with primeng, using ngZone.run(...) solved the problem on other issues.

What your toughs is it something interesting to dig in ?

@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 4, 2024
@mertsincan mertsincan added this to the Future milestone Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

@github-project-automation github-project-automation bot moved this to Review in PrimeNG Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
Status: Review
Development

No branches or pull requests

3 participants