Closed RIPT1DE closed 2 months ago
I have the same problem...
Same here
Exact same problem v8.0.2 and v9.0.0. Any fix in the works?
Same issue. Is there a way to turn off the check to see if the scroll position is 0? I only load more results when they reach the very top, which means that it's always a jarring experience.
Expected Behavior
It should restore the scroll position when the api call returns after scrolling all the way to the top.
Actual Behavior
When the api call returns, if the user has already scrolled all the way to the top by then, the scroll position isnt restored, instead, it jumps up to the top of the list again. (see demo). The scroll down behaviour is fine
Possible Solution
Steps To Reproduce / Demo (if applicable)
Demo
I have modified the modal section of the ngx-infinite-scroll demo to reproduce this issue. Timeouts have been added to the scroll up and scroll down handlers to simulate api calls, before appending new items to list. To reproduce the issue, simply open the modal and scroll rapidly to the top.
Context
I am using this as an infinite scroller for chat history. The history view is scrolled to the bottom by default, but as user scrolls up, older messages are fetched from the backend, and appended to the history. For now, it works fine, until the user scrolls very rapidly, and hits the top before api call returns.
Your Environment