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

Drag/Scroll into Nothingness

Open ascdi opened this issue 9 months ago • 3 comments

I have Container that is scrollable (long table).

If i make an Element dragable, i can use it to drag into nothingness forever, even thou there is no content there (see attatched gif). Can i prevent that somehow?

Image

ascdi avatar Mar 26 '25 11:03 ascdi

I encountered the exact same problem

updates: I found this working example from react table, and then I forked it and reinstalled @dnd-kit/core, and the bug appears

aa087159 avatar Apr 01 '25 11:04 aa087159

updates: I found that in DndContext, if you don't pass collisionDetection and modifiers, the issue would disappear

aa087159 avatar Apr 09 '25 01:04 aa087159

In my case I added the modifier "restrictToParentElement", this solve the problem.

modifiers={[restrictToHorizontalAxis, restrictToParentElement]}

roanrobersson avatar Aug 18 '25 22:08 roanrobersson