You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect widget position when parent is scaled with CSS transform (drift after refresh) #977
This is a structural problem rather than a bug in a specific version. react-rnd applies the pointer delta in screen pixels to an element that lives in a scaled coordinate space, so every pixel of drag moves the element by 1 / scale too much or too little, and the error accumulates over the drag.
The workaround with scale prop helps for a single uniform scale but breaks again with nested transforms or CSS zoom.
If you need it to work in that setup, I built frameable around exactly this case. It converts pointer positions through a Surface matrix before computing anything, and computes deltas from the initial pointer position rather than accumulating them, so there is no drift. The demo has a toggle that applies zoom: 0.6 to the parent plus a 2x viewport zoom while you drag and resize: https://kevinarce98.github.io/frameable/
Activity
chris-maheu commentedon Mar 10, 2026
I'm experiencing a similar issue, hoping for a solution soon!
KevinArce98 commentedon Sep 7, 2026
This is a structural problem rather than a bug in a specific version.
react-rndapplies the pointer delta in screen pixels to an element that lives in a scaled coordinate space, so every pixel of drag moves the element by1 / scaletoo much or too little, and the error accumulates over the drag.The workaround with
scaleprop helps for a single uniform scale but breaks again with nested transforms or CSSzoom.If you need it to work in that setup, I built
frameablearound exactly this case. It converts pointer positions through aSurfacematrix before computing anything, and computes deltas from the initial pointer position rather than accumulating them, so there is no drift. The demo has a toggle that applieszoom: 0.6to the parent plus a 2x viewport zoom while you drag and resize: https://kevinarce98.github.io/frameable/Migration from
Rndis mostly moving the position and size into state, which you likely already do to persist them. Details: https://github.com/KevinArce98/frameable#readme