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

Jump when partially offscreen item animates to height of zero for removal #417

Open
aeharding opened this issue Mar 19, 2024 · 3 comments
Open

Comments

@aeharding
Copy link
Contributor

Describe the bug

I have a UI where an item animates removal by animating to a height of zero and then removes itself from the list. The bug: Upon removal, if the item is off screen, the list will jump by one item.

To Reproduce

#416

Video here: https://github.com/inokawa/virtua/assets/2166114/72cdd3bf-533f-4250-ae91-360161d719ea

Expected behavior

Should not jump by one item.

Platform:

  • OS: [Windows, MacOS, Linux, Android, iOS] All
  • Browser: [Chrome, Firefox, Safari, Edge] Testing Safari and Firefox
  • Version of this package: [x.x.x] 0.29.1
  • Version of framework: [react, vue, solid-js] [x.x.x] React

Additional context

I am not sure if I am doing something wrong. If there is a better way to implement user-side that will not cause jump without library change, please let me know!

@inokawa inokawa self-assigned this Mar 21, 2024
@inokawa
Copy link
Owner

inokawa commented Mar 21, 2024

Currently this library requires shift props to be true if you remove items from the upper outside of viewport. So in this case setting shift: true manually may fix the jump but it will be hard to switch...

@aeharding
Copy link
Contributor Author

Thanks for taking a look! I've thought about this a bit more, and I wonder if #181 could help with this? Because then the item would not be immediately removed by Virtua when off the screen, so Virtua could properly calculate shift when the item is removed.

The only drawback is it would require additional application logic to change append only mode during animation, so maybe there is a more intuitive way...

@inokawa
Copy link
Owner

inokawa commented Apr 13, 2024

#181 was released in 0.30.0. I'm not sure if it will solve the problem, but it probably depends on your application logic.

@inokawa inokawa removed their assignment Oct 12, 2024
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