-
Notifications
You must be signed in to change notification settings - Fork 90
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
Saving new positions to state after drag #89
Comments
Thanks for workaround |
Its not actually a "workaround". nodes going crazy after release |
So you remove and re-add them... this is classic workaround for a problem. |
Same problem here, I tried everything with no success and pageX and locationx is sooo confusing :( |
Still could not find the solution. Library smoothly dragging item to wherever we want but X Y outputs are not matching with wrappers X Y |
Hello, From my experience with this library, it appears that there are some internal X/Y stored values in it (offsets ?) that are not reinitialized when passing new X/Y props. It may result in having the draggable going to crazy places after releasing the drag. The only solution i found is similar to your workaround :
Hope that this will help someone as i've been stucked for a while on this ! |
Thanks for idea. I am currently trying to solve this issue right now.
Actually bounds prop working more stable than gestureState due I think its returning current position inside wrapper. But this one also changing position some X Y position after saving to state. Also its bad bounds is not a prop of onDrag :( |
Did you find any solutions? I'm having the same problem. Dragging works fine but trying to save the positions on onDragRelease makes the image jump. |
I'm also running into this problem. |
Thanks for the workaround! Create first a state to hold this value which trigger the re-render of the entire Draggable. Add the value as a key to your draggable. Set the state every time you want the entire object to be re-rendered, for example inside the function that you call in onDragRelease Just remember that this still a workaround and it might not be the best way to go :) |
Hello, firstly thanks for this beautiful library
I couldnt figure out how to get new positions of draggable after drag or while dragging to save state. I use latest version.
Its not working properly this way, going crazy and draggable places some irrevelant places
I think as you know better the problem is g.moveX is returning touch positions. But i want to get latest position of draggable after drag. Draggable works smooth, I just want to pass latest positions to state to store them.
Thanks for your support
The text was updated successfully, but these errors were encountered: