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
Looking at your source it doesn't seem like delegation is done correctly: you can't just compare the event.target, you have to find the closest ancestor matching the selector.
This is how jQuery & Zepto do it, and that's the correct behaviour. Example:
$('body').delegate('li > a', 'click', fn);
If you've clicked a span within the a element then it won't match even though a child of the a element was indeed clicked.
Because of this requirement, firing delegated events is actually quite a bit slower, and is rarely a necessity. I've opted against them in espresso.js and have not had any issues at all.
The text was updated successfully, but these errors were encountered:
Looking at your source it doesn't seem like delegation is done correctly: you can't just compare the event.target, you have to find the closest ancestor matching the selector.
This is how jQuery & Zepto do it, and that's the correct behaviour. Example:
If you've clicked a
span
within thea
element then it won't match even though a child of thea
element was indeed clicked.Because of this requirement, firing delegated events is actually quite a bit slower, and is rarely a necessity. I've opted against them in espresso.js and have not had any issues at all.
The text was updated successfully, but these errors were encountered: