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

How do move Parent Element

Open matheuscamarques opened this issue 3 years ago • 2 comments
trafficstars

Drag the title of a modal but I want this to drag the entire modal

matheuscamarques avatar Feb 05 '22 11:02 matheuscamarques

import Draggable from 'react-draggable';

function MyComponent() {
    <Draggable>
        <div> { /* Parrent */ }
            <h1>Title</h1>
        </div>
    </Draggable>
}

Also, this is for issues and not how tos.

1rens1 avatar Feb 11 '22 07:02 1rens1

<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?".

hyunjoogo avatar Jul 01 '22 11:07 hyunjoogo