atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
32.58k stars 2.51k forks source link

How to prevent a captured element from being dragged outside its bounds #2542

Open pavelgromyko opened 7 months ago

pavelgromyko commented 7 months ago

I can't believe that such a question has not arisen, but nevertheless I could not find a solution to my problem.

The gist of my question: I have a table in which the user can drag rows up and down. I think everything is clear here. But how do you limit the drag zone? After all, the user can move the cursor to another corner of the screen and the captured row will go with the cursor. The question is: how can you prevent a captured row from being moved beyond the boundaries of the table?

I don't provide the code because I don't require a solution. I want to know if it is possible to do this with this library and the principle of the solution

dgwyer commented 6 months ago

I'd like to be able to do the same too. Any way to limit the draggable item to the bounds of the container?

pavelgromyko commented 6 months ago

@dgwyer Unfortunately, I have not yet found an answer to this question.

angular360 commented 1 month ago

Any solution for this issue?