-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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
Cannot prevent event bubbling from child to parent #1967
Comments
I imagine it's because of the way React binds event handlers to the document. React provides an overloaded Another argument for binding event handlers to mount roots perhaps, @chenglou ? |
Thanks, this is a dupe of #1691. |
This was referenced Jan 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a live demo to show this bug: http://jsfiddle.net/DA2je/
In brief, I have a parent component which has a button, when the button is clicked, a dynamic rendered component will be mounted to a child element of parent. Both parent and newly mounted child have their own
onClick
handler. In this case, when click on child node, the click event will be handled by both child and parent, even there ise.stopPropagation()
in the child event handler.The text was updated successfully, but these errors were encountered: