#14241 closed bug (notabug)
jQuery.one runs multiple times when assigned with multiple event types
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When you use jQuery.one with multiple event types, the handler can end up being triggered multiple times. I'm not sure if that's expected behaviour or not, but I thought the idea for jQuery.one was the handler could only be called once?
Anyway, you can find a test case http://jsfiddle.net/nathggns/UPAW8/3/
If the bug were to be fixed, I think the counter should never go above 1.
Change History (5)
comment:1 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
Yes, I thought it could be a docs issue. Maybe it might be worth creating a function that will only call the handler once regardless of how many event types you assign it to.
comment:3 Changed 10 years ago by
http://api.jquery.com/category/deferred-object/
Please ask for help on the forums, IRC, or Stack Overflow.
You're saying bind two event handlers: A click and mouseenter, each of which can only run once. I've filed a docs issue to clarify: https://github.com/jquery/api.jquery.com/issues/352