Skip to content
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

Issue with prepending items when reverse scrolling in Safari #367

Open
mariia-mitiureva opened this issue Feb 7, 2024 · 2 comments
Open

Comments

@mariia-mitiureva
Copy link
Contributor

Describe the bug
When I scroll up and new items are prepended while scrolling, it breaks scroll behavior in Safari.
Here is the demo https://github.com/inokawa/virtua/assets/37265338/ed93157c-65fa-4bf4-9369-a3535cb44ed9
Right after prepending there are different items visible in viewport, you can slow down the video to see it better.

If I scroll fast I looks like this
https://github.com/inokawa/virtua/assets/37265338/78b59e01-ab8b-430d-9457-50a1779d1248

To Reproduce
Open "Chat" storybook example in Safari (I only changed page size from 100 to 10)

Expected behavior
Scroll position should be adjusted correctly, the same elements should be visible as before prepending

Platform:

  • OS: MacOS
  • Browser: Safari
  • Version of this package: 0.24.0
  • Version of framework: react 18.2.0

Additional context
Might be related to #362

@mariia-mitiureva
Copy link
Contributor Author

If I modify code like this, it will work fine.

setItems delay and useFirstItemChanged instead of isPrepend.current are important changes. But delay should be significant, even 1000 doesn't always work, so that's not a solution

@inokawa
Copy link
Owner

inokawa commented Feb 10, 2024

It looks like some part of the issue is caused by #362.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants