react-draggable icon indicating copy to clipboard operation
react-draggable copied to clipboard

How to move Draggable to a div and it can only be dropped within that?

Open tianzhich opened this issue 6 years ago • 7 comments
trafficstars

Can i move a draggable to a div block and it can only be dropped within that? If i release the mouse outside the div, draggable will return to it original position. Can someone have a solution?

tianzhich avatar Jul 25 '19 02:07 tianzhich

same problem +1.

KashanSiddiqui avatar Oct 10 '19 05:10 KashanSiddiqui

bounds="parent-div"

june6969 avatar Oct 18 '19 04:10 june6969

bounds="parent-div"

@june6969 bounds="parent-div" can be useful when my draggable element inside the div block from the begining. But I mean outside to inside

tianzhich avatar Nov 14 '19 08:11 tianzhich

same problem +1.

@KashanSiddiqui seems draggable can be bounds to its offsetParent, but it defines nothing about drop zone. So I have switched to react-dnd.

tianzhich avatar Nov 14 '19 08:11 tianzhich

Same problem

luanccp avatar Nov 18 '19 13:11 luanccp

bounds="parent-div"

@june6969 bounds="parent-div" can be useful when my draggable element inside the div block from the begining. But I mean outside to inside

It gives me an error in the console: Bounds selector "parent-div" could not find an element.

theoparis avatar Jun 15 '20 22:06 theoparis

I had same problem, there is no feature in the library for drop targets. React dnd and Interact.js will work in this case.

rohailtaha avatar Feb 05 '22 06:02 rohailtaha