Ticket #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: | |
| Blocking: | Blocked by: |
Description
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
Change History
Changed 4 years ago by CarSandwich
-
attachment
Jquery-bug.html
added
comment:1 Changed 3 years ago by dmethvin
- Status changed from new to closed
- Resolution set to worksforme
Seems to work now in 1.4.
comment:2 Changed 2 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 2 years ago by jitter
- Status changed from closed to reopened
- Resolution worksforme deleted
- Milestone 1.4 deleted
comment:4 Changed 2 years ago by jitter
- Priority changed from major to high
- Status changed from reopened to open
- Version changed from 1.3.2 to 1.4.4
- Component changed from unfiled to selector
- Milestone set to 1.4.5
comment:7 Changed 23 months ago by dmethvin
Triaged as valid, but will need to wait for some Sizzle love.
comment:8 Changed 23 months 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 21 months ago by dmethvin
- Status changed from open to closed
- Resolution set to duplicate
Grouping these under a master ticket.
comment:10 Changed 21 months ago by dmethvin
Duplicate of #9810.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

Example showing bug