dnd-kit
dnd-kit copied to clipboard
rectSwappingStrategy has bad/unnecessary animation
When using rectSwappingStrategy
and arraySwap
on dropping an item that's further away than a direct neighbour has some unnecessary animation.
See this sandbox: https://codesandbox.io/p/sandbox/react-dnd-kit-swapping-order-forked-myd3wh
If you drag from 1-2, 4-3, or diagonal from 3-2 they all animate fine on dropping (swapping neighbours) If you drag from 1-4 or from 3-1 an unnecessary animation is visible (swapping distant items)
Does anyone have a temporary-fix?