You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scroll down in the list to an item (e.g. Item 28)
Click on the Log State button multiple times
Expected behavior
The list should remain the same scroll position after each click of the Log State button, but instead sometimes it fails to restore the scroll position and resets the scroll position to the top of the list.
Desktop (please complete the following information):
OS: Ubuntu
Chrome, Firefox, Safari
The text was updated successfully, but these errors were encountered:
I have a same bug and recreated it based on @mbret's example:
It's a simple navigation example where the current GridStateSnapshot is stored into the context. After navigating back to the List, the Grid should scroll back to its original position.
Scroll down in the list to an item (e.g. Item 128), then click on the "Back" Button
Expected Behaviour
The List should restore its state.
The log shows the correct scrollTop value but the VirtuosoGrid doesn't apply this to the Component (restoreStateFrom).
Describe the bug
The restoreStateFrom property doesn't restore the scroll position correctly despite the data hasn't changed.
I followed the example in (https://github.com/petyosi/react-virtuoso/blob/master/examples/state.tsx), and created a CodeSandbox example to test it out. When I repeatedly click on the Log State, the list always fails to restore the state and goes back to the start of the list.
Reproduction
codesandbox
To Reproduce
Scroll down in the list to an item (e.g. Item 28)
Click on the Log State button multiple times
Expected behavior
The list should remain the same scroll position after each click of the Log State button, but instead sometimes it fails to restore the scroll position and resets the scroll position to the top of the list.
Desktop (please complete the following information):
OS: Ubuntu
Chrome, Firefox, Safari
The text was updated successfully, but these errors were encountered: