Side navigation
#9939 closed bug (fixed)
Opened July 29, 2011 06:25PM UTC
Closed May 29, 2012 07:46PM UTC
contains selector on child of sibling not working
Reported by: | ericbock@gmail.com | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | selector | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Using jQuery 1.6.2 and FF 5 on Win 7 Pro, if I have:
<div id="dialog"></div> <div> <button>back</button> <button>next</button> </div>
this selector finds no results:
$("#dialog ~ div button:contains('next')")
instead of the expected result of the button that contains the text 'next'.
If I provide the context argument:
$("button:contains('next')", "#dialog ~ div")
or a different filter on button:
$("#dialog ~ div button:last")
the expected button element is returned.
The expected result is returned in jQuery 1.3.2 on jsfiddle, but not in any later version available there.
Attachments (0)
Change History (4)
Changed July 29, 2011 08:10PM UTC by comment:1
component: | unfiled → selector |
---|---|
priority: | undecided → low |
status: | new → open |
Changed July 29, 2011 08:10PM UTC by comment:2
milestone: | None → 1.next |
---|
Changed September 08, 2011 03:46PM UTC by comment:3
I've added a pull request to sizzle that fixes this issue:
Confirmed. http://jsfiddle.net/rwaldron/GgXr2/2/