Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onDragStop x value doesn't respect dragGrid #841

Open
citripio opened this issue Nov 13, 2021 · 2 comments
Open

onDragStop x value doesn't respect dragGrid #841

citripio opened this issue Nov 13, 2021 · 2 comments

Comments

@citripio
Copy link

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?

@boristian
Copy link

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

@joshmarnold
Copy link

joshmarnold commented May 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants