#8555 closed bug (invalid)
When attaching multiple event types with one(), function is called once for each event type
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | event | Version: | 1.5.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When binding multiple event types at once, the event handler is called once for each event type, instead of one time only as one would expect.
I don't know if this is a bug or a feature, but it might be worth mentioning in the API documentation.
Also, explaining how to remove the event handler would be great too, because calling $(this).unbind(e);
doesn't remove it from the other event types.
See the simple testcase for yourself.
Change History (4)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Component: | unfiled → event |
---|---|
Keywords: | needsdocs added |
Resolution: | → invalid |
Status: | new → closed |
We'll document this clearly.
comment:4 Changed 11 years ago by
Keywords: | needsdocs removed |
---|
Note: See
TracTickets for help on using
tickets.
Using jsFiddle, it appears that all versions of jQuery behave the same in this regard, except 1.2.6 which probably doesn't handle multiple event types being passed as the first argument of one().