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

onDragStop x value doesn't respect dragGrid

Open citripio opened this issue 3 years ago • 2 comments

Here's a demo: https://codesandbox.io/s/magical-rui-oem7n?file=/src/index.js

With a dragGrid of, say, [50,50], the draggable element moves along the grid but the x value returned at onDragStop changes freely, when it should always be a multiple of 50.

Is this a bug, or is there another (correct) way to get how many steps the element has moved?

citripio avatar Nov 13 '21 21:11 citripio

It seems to be an issue in react-draggable. The fix was merged but not released yet.

boristian avatar Feb 03 '22 11:02 boristian

Hi, is there any update on this?

In the meantime, I've found that updating react-dnd's react-draggable dependency to the latest (4.4.5) solves this specific issue

https://codesandbox.io/s/react-dnd-bug-9lffyt?file=/src/index.js:523-610

joshmarnold avatar May 25 '22 23:05 joshmarnold