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
In the CanJS 3.x-5.x, delegated events do not work correctly.
If you have a view like:
<div><p>Hello</p></div>
...and these event handlers:
'{element} div click': function(el,ev){ev.stopPropagation();console.log('parent clicked');},'{element} p click': function(el,ev){ev.stopPropagation();console.log('child clicked');}
...clicking on the <p> will cause both event handlers to be called.
stopPropagation is not stopping an event from hitting a separate delegated event listener. I need to call the actual stopPropagation. Going to reopen so I can fix this.
In the CanJS 3.x-5.x, delegated events do not work correctly.
If you have a view like:
...and these event handlers:
...clicking on the
<p>
will cause both event handlers to be called.This is happening because in this code:
can-dom-events/helpers/-make-delegate-event-tree.js
Lines 22 to 41 in cbd3130
...the loop over
handlersBySelector
should be done inside of thedo/while
loop so that the inner-most event handler will always be hit first.The text was updated successfully, but these errors were encountered: