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

Custom event dispatching for proper events handlers firing order #238

Open
fabiospampinato opened this issue Nov 20, 2018 · 0 comments
Open

Comments

@fabiospampinato
Copy link
Owner

fabiospampinato commented Nov 20, 2018

Current behavior

  • Bind a delegate event handler to #foo.
  • Bind a normal event handler to #foo.
  • If event.stopPropagation () is called from the delegate event handler the normal event handler executes too.

Expected behavior

  • We should more tightly control the event propagation logic:
    • First event handlers bound to the target element should be fired.
    • Then event handlers bound to the target element in a delegate fashion should be fired.
    • Then event handlers bound to the parent of the target element should be fired.
    • Then event handlers bound to the parent of target element in a delegate fashion should be fired.
    • And so on...
    • If at each step event.stopPropagation () is called we should stop.

This is quite tricky to do, and impossible to implement without custom dispatching logic.

It's unlikely that it will be properly fixed in the future as the required amount of changes is extensive, and as mentioned most of the times simply calling event.stopImmediatePropagation () from the delegate event handler should be enough, but this remains a bug nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant