#6322 closed bug (duplicate)
:has() does not correctly select elements if multiple criteria are inside
Reported by: | dwt | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | |
Component: | selector | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
This testcase returns false, true true
var hasFoundwithClass = 1 === $('#contingent tbody tr:has(.name:contains("foo"))').length; var hasFoundWithoutClass = 1 === $('#contingent tbody tr:has(:contains("foo"))').length; var hasFoundWithOnlyClass = 1 === $('#contingent tbody tr:has(.name)').length;
While I believe that all three selectors should select the same node.
Testcase attached.
Attachments (1)
Change History (7)
Changed 13 years ago by
Attachment: | reduction.html added |
---|
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
This appears to be more complex than simply being an issue with multiple selections inside of :has()
The strangest manifestation of this issue is that with the provided markup, $("tr:has(:contains(foo).name)") returns 1 element, while $("tr:has(.name:contains(foo))") returns 0 elems.
In the case of the initial selection, jQuery never even enters the pseudoselector code that handles :contains.
comment:3 Changed 13 years ago by
Component: | unfiled → selector |
---|
comment:5 Changed 12 years ago by
Priority: | → undecided |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
jsbin as per ajpianos request http://jsbin.com/atogo3/edit