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

is there any way to stop event propagation with event delegation on? #3298

Open
LeJared opened this issue Feb 22, 2019 · 3 comments
Open

is there any way to stop event propagation with event delegation on? #3298

LeJared opened this issue Feb 22, 2019 · 3 comments

Comments

@LeJared
Copy link

LeJared commented Feb 22, 2019

Is there any way to stop event propagation with event delegation in iterative sections on?

@fskreuz
Copy link
Contributor

fskreuz commented Feb 22, 2019

Propagation should be stoppable via the usual means (stopPropagation, returning false). If it doesn't work, then it might be a bug.

Note that for delegated handlers, your event will have already bubbled from the target element (the actual element clicked) to the delegate element (the element holding the event handler). Stopping propagation from a delegate handler will only stop it from the delegate element upwards.

@LeJared
Copy link
Author

LeJared commented Feb 26, 2019

I've fiddled around a little bit:
https://jsfiddle.net/lejared/t0ydn94e/41/

stopPropagation doesn't work at all with event delegation on.

return false will stop event propagation within the iterative section but the event will still be fired outside.

When event delegation is disabled everything works as expected.

@LeJared
Copy link
Author

LeJared commented Mar 5, 2019

I've done some more Testing:
https://jsfiddle.net/lejared/t0ydn94e/47/

It seems like returning false within an iterative section with event delegation on also suppresses native js events for all nested elements, which are commonly used in decorators, thus making them stop working.

This is unexpected too and does not match the behavior of regular event propagation, when delegated events are turned off.

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

2 participants