Bug Tracker

Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#5414 closed bug (duplicate)

Live event binding not matching selector

Reported by: CarSandwich Owned by:
Priority: high Milestone: 1.next
Component: selector Version: 1.5
Keywords: live selector Cc:
Blocked by: Blocking:


When using this selector with the live() it will incorrectly bind to all tr's on a page.

$('#ExampleTable tbody tr:not(:first)').live("dblclick", RowEvent);

I have attached an example of the bug. It highlights the items the live event should bind to, yet clicking any tr on any table on the page fires the live event.

Attachments (1)

Jquery-bug.html (2.7 KB) - added by CarSandwich 13 years ago.
Example showing bug

Download all attachments as: .zip

Change History (11)

Changed 13 years ago by CarSandwich

Attachment: Jquery-bug.html added

Example showing bug

comment:1 Changed 12 years ago by dmethvin

Resolution: worksforme
Status: newclosed

Seems to work now in 1.4.

comment:2 Changed 12 years ago by anonymous

Still broken. Here is the same example in JsFiddle. http://jsfiddle.net/VtdQH/

Observe the rows are highlighted correctly, however the double click live event is still bound to all tr's on the page.

Eg you can double click any of the cheeses or the first beer, they are not part of the rows filter and should not be bound.

comment:3 Changed 12 years ago by jitter

Milestone: 1.4
Resolution: worksforme
Status: closedreopened

comment:4 Changed 12 years ago by jitter

Component: unfiledselector
Milestone: 1.4.5
Priority: majorhigh
Status: reopenedopen

test case

The underlying issue seems to be with the is() check

test case for is()

comment:5 Changed 12 years ago by jitter


comment:6 Changed 12 years ago by jitter

#8236 is a duplicate of this ticket.

comment:7 Changed 11 years ago by dmethvin

Triaged as valid, but will need to wait for some Sizzle love.

comment:8 Changed 11 years ago by dmethvin

Note that :first-child does work correctly. I would strongly warn people away from using jQuery positional selector extensions for events.

comment:9 Changed 11 years ago by dmethvin

Resolution: duplicate
Status: openclosed

Grouping these under a master ticket.

comment:10 Changed 11 years ago by dmethvin

Duplicate of #9810.

Note: See TracTickets for help on using tickets.