Bug Tracker

Opened 14 years ago

Closed 12 years ago

#3462 closed bug (invalid)

Multinamespaced event handler bug

Reported by: morgan Owned by: brandon
Priority: low Milestone:
Component: event Version: 1.2.6
Keywords: event namespace bind Cc:
Blocked by: Blocking:


As first described by Yehuda and reported to jquery-dev mailing list by Brandon Aaron http://groups.google.com/group/jquery-dev/browse_thread/thread/91adffebadfd0a53/2db48b9d486bc45e

Summary of the bug. If binding an event with one handler in two (or more) different namespaces, only the last one is bound. This happens because the namespace is not checked on other events when binding new ones. So each time a new namespaced event is bound, the old one(s) are overrun.

This patch is more of a working proof on concept, but it does pass all the event test cases. What is does is adds a default namespace ("*") to any event not containing a namespace. The event cache structure is also changed.

/cache/jq.uid/event/handle.guid(.type) becomes to /cache/jq.uid/event/namespace/handle.guid.

So events without a namespace ('click') end up in something like /cache/15/click/*/3().

Where an event with a namespace ('click.custom') would be /cache/15/click/custom/3()

Attachments (1)

event_namespaces.patch (4.2 KB) - added by morgan 14 years ago.
Patch to add better event namespace support

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by morgan

Attachment: event_namespaces.patch added

Patch to add better event namespace support

comment:1 Changed 12 years ago by Rick Waldron

Milestone: 1.3
Priority: majorlow
Resolution: invalid
Status: newclosed

No longer applicable. If this can still be reproduced, we will gladly reopen.

Note: See TracTickets for help on using tickets.