-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Batch deletion of removed items #462
Conversation
could you checkout the hooks.8.x branch and see if this is still an issue? it's going to get all refactored soon and in the new branch it removes lazily by default already |
I'll give it a try, but I'll need to work out how to use hooks first, so it may take a bit. Or am I missing a way to still use |
No, for clarity it's been singled out, it will come back when i merge. I can merge this - just give me some time to test it, super busy right now - but i won't forget it. |
I'm still seeing this issue on |
@grrowl could you make a minimal codesandbox to show the effect? |
Sure thing: this demo exhibits the behavior using hooks and the latest react-spring: https://codesandbox.io/s/my869ojmjj |
@grrowl could you give me a super quick rundown how you expect it to behave? |
Sorry, I didn't explain the problem exhibited by the demo. When you click "Filter", we re-render with only the item "b". But notice, the item "b" moves into the space taken by "f", even though all the children are keyed and should maintain their position through transitions in and out. So, what we expect when changing the items array is rendering a list of (using punctuation to illustrate fading:
The problem is the items are re-ordered when rendered through the "transition" phase as:
In my example I included the edit: my problem is as described in linked pull request #461 — but testing locally (merging |
yeah, i think batch delete wouldn't have an effect on order, and it actually does batch delete now in some situations. if you want to look at it, that would be amazing as my time's limited right now. it's here somewhere: https://github.com/react-spring/react-spring/blob/master/src/useTransition.js#L250-L259 this is how i debug stuff: https://github.com/react-spring/react-spring-examples/blob/master/README.md |
…rs#462) Currently, there are some cases that the component doesn't render because it finds that the height is 0. You will see an output like This can be avoided by providing the desire height for the responsive chart
Batch the deletion of removed items after they transitioned out. See #461.