react-draggable
react-draggable copied to clipboard
Is it possible to somehow detect whether a Draggable has been dropped over a specific element?
I want to be able to delete or otherwise change a Draggable when it's dropped over another div, is that possible?
If you put a display: hidden element over your drop area element with a higher z-index than the draggable element, you can have an onMouseUp event that listens for the drop and reads the current state of dragging item. That was my solution to implementing this, but there is almost certainly a better one out there somewhere. I can maybe write a demo when I'm not at work, if you'd like.
@ewdaimonia onMouseUp solution works in desktop but not mobile. In mobile, onMouseUp fires when i click on the div element(drop area), but when I drag an element over it, onMouseUp does not fire