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

Element jumps back and forth between two sortable contexts when dragged above the contexts

Open mattwhitson opened this issue 1 year ago • 2 comments

Easily reproducable with one of their samples on codesandbox. All I did was add some margin to the top of the board section and then dragged the elements across above the SortableContexts and the draggable elements start to go haywire. Any idea on how to fix, or if not, how to stop the user from dragging elements above the contexts?

https://github.com/user-attachments/assets/319d33a5-13e4-448c-a691-ae2bd2a97257

Here's a link to the code sandbox if anyone's interested in poking around. Cheers https://codesandbox.io/p/sandbox/vigilant-cannon-6kh5mx

mattwhitson avatar Jul 30 '24 06:07 mattwhitson

This is probably due to the collision detection strategy did you tried to change it to pointerWithin built in strategy? For me this was the fix.

AmiciD avatar Oct 22 '24 14:10 AmiciD

@mattwhitson Have you ever managed to find a solution to this issue?

I'm currently experiencing the same issue when using the closestCorners collision detection strategy and moving an element between empty sections above the actual sections (like you're showing in your demo).

engfragui avatar Sep 01 '25 14:09 engfragui