Open LeJared opened 5 years ago
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.
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.
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.
Is there any way to stop event propagation with event delegation in iterative sections on?