react-draggable
react-draggable copied to clipboard
How do move Parent Element
trafficstars
Drag the title of a modal but I want this to drag the entire modal
import Draggable from 'react-draggable';
function MyComponent() {
<Draggable>
<div> { /* Parrent */ }
<h1>Title</h1>
</div>
</Draggable>
}
Also, this is for issues and not how tos.
<Draggable handle=".cursor">
<div className="box no-cursor"> { /* Parrent */ }
<h1 className="cursor">Title</h1>
</div>
</Draggable>
if you drag <h1> tag, Entire <div> will move
You can think that handle=".cursor" attribute mean "What kind of objects will you control?".