You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
So this issue was kind of raised in #2044 but the solution ended up being just keep event bubbling disabled or enabled globally and no other option.
Why there is no way to keep event bubbling enabled globally and be able to stop bubbling only on certain callbacks?
Solution
So as I understand from this comment #1542 (comment)
There was supposed to be a wrapper for Event that would enable stopping the bubbling, was this just forgotten or not implemented for a reason?
Environment:
Yew version: [ master]
Questionnaire
I'm interested in fixing this myself but don't know where to start
I would like to fix and I have a solution
I don't have time to fix this right now, but maybe later
The text was updated successfully, but these errors were encountered:
So in #2044 I mentioned about using Event::cancel_bubble and referenced the WHATWG standard: "The cancelBubble getter steps are to return true if this’s stop propagation flag is set; otherwise false."
So we could check this as we are manually bubbling up. This does mean we have to keep jumping over to JS land to
stop bubbling and to check if it has been stopped on each loop iteration.
Note: that MDN does have a deprecated warning on cancelBubble but it seems to be regarding the use of it to stop propagation.
If we had Event wrappers then we could keep it all local to wasm. I think Event wrappers weren't forgotten it is just quite a bit of work as you need to wrap all the event types :)
It might be worth considering this issue from gloo and my failed custom event support PR for some inspiration if going the Event wrapper route (which I think is the end goal).
Problem
So this issue was kind of raised in #2044 but the solution ended up being just keep event bubbling disabled or enabled globally and no other option.
Why there is no way to keep event bubbling enabled globally and be able to stop bubbling only on certain callbacks?
minimal testing code:
Solution
So as I understand from this comment #1542 (comment)
There was supposed to be a wrapper for
Event
that would enable stopping the bubbling, was this just forgotten or not implemented for a reason?Environment:
master
]Questionnaire
The text was updated successfully, but these errors were encountered: