Bug Tracker

Opened 10 years ago

Closed 10 years ago

#12545 closed bug (invalid)

.on() not working with selector path starting at selected element on v1.8.1

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.1
Keywords: Cc:
Blocked by: Blocking:


On version 1.8.1, $(element).on(event,selector,fn) isn't working when the selector path is starting at the same level or at a higher level than element path. This was working on version 1.8.0

1.8.1 (not working) http://jsfiddle.net/TxsmH/ 1.8.0 (working) http://jsfiddle.net/TxsmH/2/

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Owner: set to [email protected]
Status: newpending

This was actually an intended change, but I agree it needs to be documented. Non-positional selectors in delegated events were the only place where the selector "looked up" when trying to do a match. The case you have there is actually very unusual because it should have "#b" and there's no need for "#a #b". In general, if you attach a delegated event at or below a particular element there is no need to check that it is a descendant of that element.

I hope that explains why the change was made...can you adjust your selectors?

comment:2 Changed 10 years ago by trac-o-bot

Resolution: invalid
Status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Note: See TracTickets for help on using tickets.