Open danielsantiago opened 1 year ago
For reference, I did a hack or workaround adding a ResizeObserver before doing prepend to do the correct scroll top calculation.
https://codesandbox.io/s/sandpack-project-forked-sqjxcj?file=/App.js
Confirming, the problem is related to increaseViewportBy. This should work, I will look for a fix.
Has anyone got a solution to this issue?
Describe the bug When you are at the top of the list, and you prepend a new item with an unknown height, the list is changing the scroll position.
Reproduction https://codesandbox.io/s/sandpack-project-forked-gzs242?file=/App.js
To Reproduce Steps to reproduce the behavior:
Expected behavior When prepend there should be no automatic scroll changes.
Screenshots https://github.com/petyosi/react-virtuoso/assets/619122/8dfcfe79-7795-41f4-bdf4-cff5ace6d2b2
Desktop (please complete the following information):
Additional context If I remove
increaseViewportBy
then it works the first time I doprepend
, but if I then manually scroll to the top of the list and doprepend
again, then it fails even without definingincreaseViewportBy
.