Skip to main content

Bug Tracker

Side navigation

#9901 closed bug (fixed)

Opened July 24, 2011 09:55AM UTC

Closed September 20, 2011 01:18PM UTC

Last modified March 09, 2012 12:19AM UTC

event.handleObj.namespace incorrect when using .delegate

Reported by: salohcinzero@gmail.com Owned by: dmethvin
Priority: low Milestone: 1.7
Component: event Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

Affected versions: 1.4.4 and 1.6.2 (likely all other versions with .delegate)

Browser: FF 5

Operating system: Win7 64-bit

Repro steps:

1) I created a reduced example at: http://jsfiddle.net/TTp8w/3/

2) Click both links

3) Inspect console log statements which show observed and expected behavior

Description:

When i use delegate to bind namespaced event handlers, i need to use the namespace of the handler. This is stored in event.handleObj.namespace, but when using .delegate, this value seems to get garbled with the selector string.

Example:

$("#container").delegate(".test1", "click.test1", function(e) { console.log(e.handlerObj.namespace) });

Expected log statement: 'test1'

Observed log statement: '`test1.click.test1'

Attachments (0)
Change History (3)

Changed July 24, 2011 10:03AM UTC by anonymous comment:1

Updated jsFiddle link http://jsfiddle.net/TTp8w/4/

There are now 3 links:

1 bound with .delegate

1 bound with .live

1 bound with .bind

.bind behaves as expected, but both .delegate and .live do not.

Changed July 24, 2011 02:10PM UTC by dmethvin comment:2

_comment0: Confirmed. In the changes I'm doing for 1.7, this is fixed as a result of categorizing delegated events under the actual event name, rather than "live". Note to self: need test case.1311516687495149
component: unfiledevent
milestone: None1.7
owner: → dmethvin
priority: undecidedlow
status: newassigned

Confirmed. In the changes I'm doing for 1.7, this is fixed as a result of categorizing delegated events under the actual event name, rather than "live". Note to self: need QUnit test for this.

Changed September 20, 2011 01:18PM UTC by Dave Methvin comment:3

resolution: → fixed
status: assignedclosed

Fix #9901, verified by this unit test.

Changeset: 63c9719330668f0165da1390e3aa53d4011aa0c2