Bug Tracker

Opened 10 years ago

Closed 10 years ago

#5779 closed bug (fixed)

Bad behavior on .bind() with multiple events if one of them is special

Reported by: jarrowwx Owned by: brandon
Priority: major Milestone: 1.4.1
Component: event Version: 1.4
Keywords: Cc:
Blocked by: Blocking:

Description

When you call bind with a space separated list of events, it loops through them as a shortcut for multiple calls to bind.

Unfortunately, if you call bind with a call to a special event, the code replaces the passed in handler with the one that is generated by the special event handler. This means that any other events in the list yet to be processed are altered in the process.

If the code were to differentiate between the original handler and the 'active' handler, and set the 'active' handler back to the original at the top of the loop, this problem would be solved.

Admittedly, it is an edge case, but the behavior is most definitely not what it should be. I've left the priority at the default value.

For more notes, see the thread in jquery-dev: "jQuery.event.special\['type'\].add modifies handler of other types"

Change History (1)

comment:1 Changed 10 years ago by john

Milestone: 1.41.4.1
Resolution: fixed
Status: newclosed
Version: 1.3.21.4
Note: See TracTickets for help on using tickets.