-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
.once doesn't go well with .self #4846
Comments
Thanks for filing the issue. Please follow the Issue Reporting Guidelines and provide a minimal JSFiddle or JSBin containing a set of reproducible steps that can lead to the behavior you described. |
Hi, I am not the OP but I think I managed to reproduce the issue he was referring to. I attached a JSFiddle below for illustration.
Hope this helps. |
@boristhuy Thank you for providing JSFiddle. This is exactly what I meant. |
This should be a bug. Currently the event handle will be removed once it enters, in fact it is not invoked indeed because of the modifiers check. Maybe we need to update the like (function(){
var called = false;
return function($events){
// modifiers check
// called check
if (called)return;
called = true;
// handler code
}
})() |
As for
|
@defcc I fixed it by returning a special value from handlers that are prevented from execution. This may not address the (3) bug you mentioned, but let's handle that in a separate PR if necessary. |
Consider following element:
If we click on "Eat" word, everything works as expected. The event is being fired once and we are happy.
But if we click on "me", which is child node, and then we click on "Eat", the event will never be fired! It seems like
.once
is too easy on judging an event as fired.I think
.once
should mark it as done only if it has been fired in fact.The text was updated successfully, but these errors were encountered: