[BUG] startReached and endReached called in succession
See original GitHub issueDescribe the bug
In a particular scenario,startReached and endReached called in succession.
Reproduction https://codesandbox.io/s/romantic-mountain-tzfbw
To Reproduce Steps to reproduce the behavior:
- once initial items are loaded, scroll up to fetch previous items
- observe the console logs
Expected behavior
only startReached should be called.
Additional context This issue isn’t happening if I fetch the next items first and then scroll up to fetch previous items.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
There is no way to reset endReached/startReached ... - GitHub
It appears when using regular mode, you can now reset endReached by change the object reference for the data prop (see #182) but...
Read more >CP 544 - ADEGIS
The CP 544 communications processor enables data to be transferred between your programmable controller (PLC) and.
Read more >V5-beta: How to create a full transparent background around the ...
In this PhotoSwipe test album I tried to make the area around the slide image fully transparent, so that I see there the...
Read more >How does chance node work in subgame solving ... - IssueHint
[BUG] startReached and endReached called in succession, 6, 2021-06-10, 2022-10-02. Implement the logic for `RequiredDuringSchedulingRequiredDuringExecution` ...
Read more >react-virtuoso - developer blog
[BUG] startReached and endReached called in succession. once initial items are loaded, scroll up to fetch previous items 2. Additional context This issue ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I examined the linked example in further detail, and this is going to be quite hard to fix on the lib side. Let me explain:
When scrolling up and new items are prepended, the lib scrolls down first in order to compensate for the newly introduced content. When items are prepended, the browser shifts back to where the list should be.
In your case, however, the initial amount of items is small, and the scroll-down action reaches the bottom of the list. It is fairly easy to avoid that - you need to bump the amount of the initially loaded items.
On a side note, you are also using negative values for the
firstItemIndex- which causes some internal calculation issues. Start from a really large item instead.I will keep this bug open for now, but again, fixing it is going to be quite hard (I need to detect that scrolling and ignore the end reached).
Nah, got it. I was not reading your report correctly