-
Notifications
You must be signed in to change notification settings - Fork 49
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
Click events #71
Comments
Any update on this? I'm having the same issue. When I nest a button inside my draggable element and try to initiate a drag event by holding and moving my cursor(onMouseDown event to be more exact) over it - nothing works, which is very strange. The issue seems to be that react-movable initiates a drag during the onClick event, which makes interacting with any nested clickable elements pretty much impossible. Perhaps we can change the logic here a little bit? For example, react-movable could listen for the onMouseDown event and initiate drag after some delay(~200ms)/or movement. This way, we could differentiate between the actual drag event and the onClick event. |
That's how it already works. Can you provide an example? |
Sure! I created a small code sandbox that illustrates the problem: https://codesandbox.io/s/musing-dan-cbjs5?file=/src/App.tsx. In my case, buttons should act as drag handles and also preserve their original click functionality |
Oh, you can't have it both ways. I would recommend a dedicated drag handle button and another button next to it. |
I have been trying to use onDoubleClick and onClick but those events are not working. do you have a workaround?
The text was updated successfully, but these errors were encountered: