Modify ↓
Ticket #8383 (closed bug: invalid)
.closest() doesn't work with > selector
| Reported by: | wheresrhys@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
Test case is here: http://jsfiddle.net/77Qm9/ Not sure what correct behaviour should be? Maybe ignore the > completely, i.e treat ">selector" as "selector", rather than returning empty jQuery
Change History
comment:2 Changed 2 years ago by wheresrhys@…
After reading the specification, I've submitted a new ticket http://bugs.jquery.com/ticket/8384 which is more general... so this one can be closed if you like
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Or thinking about it more, the use case I have woudl involve treating the context as the top-level parent, so that
$(sel1).closest(>sel2,context)
returns the child of context that matches sel2 and contains sel1