-
Notifications
You must be signed in to change notification settings - Fork 371
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
Resizable nested inside of draggable creates drag with resize handler #18
Comments
Same problem here, any resolution? |
I guess I just found some clues, first you should put cancel prop in the draggable, like this
Then you need to have a customised onResize function, which draws the resized box, like this:
the Resizable component will be like this:
This is very roughly implementation, I found the code in this link: https://github.com/STRML/react-resizable/blob/master/lib/ResizableBox.jsx |
Hey. I've just pushed #82 for this. Please check it out and let me know your comments. |
I reproduced my scenario in here. I think it is a special case. I use Resizable inside a useDrag element (react-dnd). And when resizing, the drag event is propagates to the useDrag-element. I tried to use e.stopPropagation(), but it didn't work. Then I gave e.preventDefault() a try and It worked !! Anyone can help me know why? |
Given the following code:
Where
<Draggable />
is the react-draggable module, when resizing using thereact-resizable-handle
, it also triggers the drag of the parent element. Is this an issue or is there a way to 'cancel' the resize from bubbling upwards to the parent draggable?The text was updated successfully, but these errors were encountered: