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

prevent event bubble #115

Open
guaijie opened this issue Sep 12, 2024 · 0 comments
Open

prevent event bubble #115

guaijie opened this issue Sep 12, 2024 · 0 comments

Comments

@guaijie
Copy link

guaijie commented Sep 12, 2024

provide a way to prevent events from bubbling up

<Draggable
  className="drop-view"
  onDragStart="(v) => console.log('outer-drag-start:',  v)"
>
  <Draggable className="drag-item">1</Draggable>
  <Draggable className="drag-item">2</Draggable>
  <Draggable className="drop-view">
    <Draggable className="drag-item" onDragStart="(v) => console.log('inner-drag-start:',  v)"> 3</Draggable>
    <Draggable className="drag-item"> 4</Draggable>
  </Draggable>
</Draggable>

I want the child's onDragStart event to be triggered without the parent's onDragStart event being triggered at the same time, so that the parent event's behavior overrides the child event (because the child event fires first).

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

1 participant