-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
No way to stop event bubling. #2044
Comments
#1542 registers all event handlers on to the #1542 added some comments regarding this issue: yew/packages/yew/src/virtual_dom/listeners.rs Lines 24 to 34 in e65688e
yew/packages/yew/src/virtual_dom/listeners.rs Lines 512 to 514 in e65688e
This comment in the PR suggests that Yew could stop bubbling using |
@mc1098 Thanks for your help! it's not a bug but an expected behavior then. We definitely need a documentation section on bubbling and introduce |
Agreed, I didn't add this to the event page but I think that's the best home for it!
I don't think it particularly is because it will prevent event bubbling for every event handler unless changed back, whereas |
Problem
Before 68d2fdb,
Event::stop_propogation
works insideCallback
s. After that, bubbling is always enabled, even ifstop_propagation
is called, the ancestor's callback will still gets called.Steps To Reproduce
minimal testing code:
Click on the child, and the parent's callback gets called despite there is a
stop_propogation
.Expected behavior
stop_propogation
should stop the bubbling.Environment:
master
]Questionnaire
The text was updated successfully, but these errors were encountered: