Skip to main content

Bug Tracker

Side navigation

#5779 closed bug (fixed)

Opened January 10, 2010 03:35PM UTC

Closed January 25, 2010 10:01PM UTC

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"

Attachments (0)
Change History (1)

Changed January 25, 2010 10:01PM UTC by john comment:1

milestone: 1.41.4.1
resolution: → fixed
status: newclosed
version: 1.3.21.4