Bug Tracker

Modify

Ticket #9939 (closed bug: fixed)

Opened 3 years ago

Last modified 23 months ago

contains selector on child of sibling not working

Reported by: ericbock@… Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.6.2
Keywords: Cc:
Blocking: Blocked by:

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.

 http://jsfiddle.net/ericbock/GgXr2/

Change History

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to selector

comment:2 Changed 3 years ago by rwaldron

  • Milestone changed from None to 1.next

comment:3 Changed 3 years ago by ericbock@…

I've added a pull request to sizzle that fixes this issue:

 https://github.com/jquery/sizzle/pull/70

comment:4 Changed 23 months ago by timmywil

  • Status changed from open to closed
  • Resolution set to fixed

Update Sizzle: fixes a bug with the adjacent combinator. Fixes #9939.

Changeset: de1d3fa38f65f235fd60cb213c41eb4b32b84c95

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.