-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
[BUG] scrollSeekConfiguration with reversed list: flickering #410
Comments
Confirming that this is a bug, The scrollSeek system should wait for the didMount observable. |
I tried to implement it and create a PR. At least in this case didMount seems to be always true (so would not have any effect):
|
True. It might have to wait for this flag: https://github.com/petyosi/react-virtuoso/blob/master/src/initialTopMostItemIndexSystem.ts#L10 |
scrolledToInitialItem has the same problem :) (always true). Seems like
is firing to fast. For now i just disabled the scrollSeek. |
This flag will turn true after the initial destination has been reached. My understanding is that you are trying to avoid that call. At any case, I will look at that at some point. |
@petyosi FYI, just checked: Same happens with endless scroll ("prepending-items"); the velocity "jumps" for a moment when startReached is called and the new items are prepended. |
That's understandable, based on how velocity and prepending work. Scrolling is readjusted to accommodate the prepended items. |
Any updates? |
Tried to use scrollSeek + reverse endless and got the same results. Ended up disabling it. In the meantime, is there a callback that can be hooked into to get the current scroll velocity? The goal is to adjust the fetch page size - if the user is scrolling quickly, we will fetch more data to pre-pend to the list |
@tomholford you can hook up to the |
Great suggestion, will give this a shot. Thanks! |
Describe the bug
When using scrollSeekConfiguration with a reversed list the scrollSeekConfiguration.onEnter callback is called directly on the first render with a high velocity (probably height of the list) which causes the ScrollSeekPlaceholder to be shown. It seems that this was introduced in version 0.21.0-alpha.1.
Reproduction
https://codesandbox.io/s/react-virtuoso-scrolling-issue-forked-xis50?file=/src/App.js
To Reproduce
Expected behaviour
scrollSeekConfiguration.onEnter should not be called on first render without actual scrolling
Screenshots
Desktop (please complete the following information):
Additional context
isScrolling gets also called on first render.
The text was updated successfully, but these errors were encountered: