clauderic / dnd-kit

The modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.
http://dndkit.com
MIT License
12.9k stars 640 forks source link

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

Open mattwhitson opened 2 months ago

mattwhitson commented 2 months ago

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

AmiciD commented 4 days ago

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.