dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

rectSwappingStrategy has bad/unnecessary animation

Open BeemWex opened this issue 10 months ago • 1 comments

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?

BeemWex avatar Apr 17 '24 15:04 BeemWex