react-draggable
react-draggable copied to clipboard
Get offsetLeft and offsetTop of the element w.r.t parent
How to get the offsetLeft and offsetTop of the element which is being draggable ? This returns the position of the element with respect to its parent container
I was looking for the same thing. This works for me
const onDrag = (e, d) => { console.log(d.x, d.y); }