react-dnd / react-dnd

Drag and Drop for React

Home Page:http://react-dnd.github.io/react-dnd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parent component's native events affect react-dnd

YingJian-hu opened this issue · comments

Is your feature request related to a problem? Please describe.
I have a parent component that uses the native onDragStart method, and my child component is wrapped with react-dnd. When dragging in the child component, the event bubbles up to the parent component. How do I prevent the event from bubbling in the useDrag of the child component?

Describe the solution you'd like
Subcomponents have interfaces to prevent events from bubbling up

Describe alternatives you've considered
no plan

Additional context
Only the child components need to be wrapped with react-dnd, the parent component does not need to be wrapped

I met an issue looks like yours. In the parent component, I have a child component wrapped with react-dnd, but another child component uses the navtive "draggable=true & onDragStart", but this component is not working, try to drag it, no response.

I met an issue looks like yours. In the parent component, I have a child component wrapped with react-dnd, but another child component uses the navtive "draggable=true & onDragStart", but this component is not working, try to drag it, no response.

oh, I found my answer here: #3304