Shaddix / dnd-kit-sortable-tree

Tree component for React with ability to drag-and-drop items throughout the tree. Based on an example from dnd-kit (https://github.com/clauderic/dnd-kit).
MIT License
94 stars 23 forks source link

Slight 1-frame visual glitch on drop until state update resolves #34

Open maxhudson opened 10 months ago

maxhudson commented 10 months ago

There is a relatively minor, but still noticeable jump upon drop that would be great to be resolved.

I believe the transform that's being applied while dragging gets removed on drop, so there's a 1 frame/processor-tick delay until setState(changedItems) resolves on the next render.

Video here:

https://github.com/Shaddix/dnd-kit-sortable-tree/assets/7915687/55cb2979-8041-4f7e-829d-2319ffbfcd2b

Original related issue: https://github.com/Shaddix/dnd-kit-sortable-tree/issues/19

Let me know if I can provide any more info to help debug!

kachkaev commented 3 weeks ago

👋 @maxhudson have you found a workaround by a chance?