Closed jeffaburt closed 8 months ago
While I understand why you may consider this a bug, the library has never claimed supporting scroll snap. If you're interested in exploring the underlying problem, I'm happy to accept a PR on the matters. However, I am not going to work on that by myself, as my own usage of the library has no use case for it.
Describe the bug When scroll snap is enabled (scrollSnapType and scrollSnapAlign),
scrollTo*(...)
methods do not scroll to the right place. Disabling scroll snap restores proper scrollTo behavior.Reproduction
Scenario 1: TikTok style UI (where each item takes up full screen)
https://codesandbox.io/p/sandbox/react-virtuoso-full-height-cytgrc
https://github.com/petyosi/react-virtuoso/assets/2835199/5fb37900-fb3d-436d-8a4a-db9ccf9d33ae
Scenario 2: Normal UI where multiple items are shown on the screen
https://codesandbox.io/p/sandbox/react-virtuoso-scroll-snap-normal-height-39mt4x
https://github.com/petyosi/react-virtuoso/assets/2835199/8ce01db0-9941-47f4-887a-c7bc721bf706
https://github.com/petyosi/react-virtuoso/assets/2835199/2a8e2337-f836-4643-84b8-3c848d2e61c7
To Reproduce
scrollTo*(...)
methodsExpected behavior The item specified should be visible on screen.
Desktop (please complete the following information):