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

Get offsetLeft and offsetTop of the element w.r.t parent

Open vickywar opened this issue 3 years ago • 1 comments

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

vickywar avatar Mar 04 '21 17:03 vickywar

I was looking for the same thing. This works for me

const onDrag = (e, d) => { console.log(d.x, d.y); }

SorenJ89 avatar Mar 27 '22 21:03 SorenJ89