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

Use `top left` instead of transform?

Open feresr opened this issue 3 years ago • 6 comments

Is it possible to use the top/left css properties instead of transform?

...or alternatively, keep using transform for dragging but then set reset its value on onDragStopped (and move the new position values to top/left) for performance?

feresr avatar Nov 13 '22 06:11 feresr

Looking for the same behavior. Zoom amount of the window affects the position set by transform.

abrehamgezahegn avatar Dec 01 '22 18:12 abrehamgezahegn

+1

twinkle77 avatar Jun 01 '23 13:06 twinkle77

Having the same problem. I would like to store the new hotspot position persistently when drag stopped. This will cause the hotspot to be rendered at a new left/top position (the end point of the drop). However, since the library keeps the transform, the translation is being added to this position.

It would be super nice if there was an option to reset the transform to translate(0,0) on dragStop.

derwaldgeist avatar Dec 10 '23 18:12 derwaldgeist

Got the same problem with RTK Query, having the position of the draggable div stored in a database that gets updated once the dragging finishes, which invalidates the cache and repositions the div with its new left/top. After changed object arrives in the component, the transform stays, which doubles the movement made.

Crashkurs avatar Jan 27 '24 00:01 Crashkurs

+1

Talha345 avatar Apr 06 '24 18:04 Talha345

I'm interested in it as well, because monaco editor suggestion layer is not positioned correctly when parent element is positioned with transform

https://github.com/microsoft/monaco-editor/issues/4580

acherkashin avatar Jul 24 '24 15:07 acherkashin