-
-
Notifications
You must be signed in to change notification settings - Fork 584
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
wrong event callback ordering on first event handler #2409
Comments
I'm not sure about the distinction between "first in the tree" and the rest. I can say that events are delegated to the |
Is there some documentation on So i guess this is intended (or more undefined) behavior when mixing DOM event handlers and leptos event handlers without |
Documenting |
Describe the bug
The call order of events for the first event handler on an element with respect to
window
is incorrect and does not follow the bubbling rules for events.The bubbling order is (for example a button and the
pointerdown
event):button -> parent -> window
But the current version calls the event handlers in the order
window -> button -> parent
for the first event handler appearing in the call tree.All following event handlers are called in the correct order.
Leptos Dependencies
For example:
Given the following code (also found here)
When clicking any button labeled
CLICK
, the text line next to the button should get appended bybutton parent window
(which is the expected call order explained above)The other text lines just get appended by
window
because the event handler onwindow
is the only one called for this component.To Reproduce
Steps to reproduce the behavior:
window button parent
(wrong order)button parent window
(right order)Expected behavior
Expected the first button press to behave just like the other ones: produce the text sequence
button parent window
The text was updated successfully, but these errors were encountered: