Closed matthewwo closed 1 year ago
Confirming - I managed to reproduce it on my side, though it took me a while. Thank you for the sandbox.
:tada: This issue has been resolved in version 4.4.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Describe the bug The
restoreStateFrom
property doesn't always 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 sometimes fails to restore the state and goes back to the start of the list.Reproduction CodeSandbox
To Reproduce
Log State
button multiple timesExpected 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.Screenshots
Desktop (please complete the following information):
Additional context I believe the same issue also affects the chat example where repeatedly switching between chat-rooms will lose the scroll position at some point.