Bug Tracker


Ticket #10562 (closed bug: fixed)

Opened 2 years ago

Last modified 2 years ago

siblings method returns unexpected elements when using Sizzle-invoking pseudo-selectors

Reported by: interdream Owned by:
Priority: low Milestone: 1.7
Component: selector Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:


When using a selector including a pseudo-selector that requires Sizzle with the siblings method, unexpected elements are returned.

Given the following markup:

<div id="d1"></div>

And the following jQuery:

$("#d1").siblings("div span:last");

You would expect that an empty set be returned, as there are no span siblings of #d1. However, the div containing the span is returned.

 JSFiddle example. Reproduced in Chrome 14, Firefox 7 and IE9.

 Related StackOverflow question

Change History

comment:1 Changed 2 years ago by dmethvin

  • Priority changed from undecided to low
  • Resolution set to fixed
  • Status changed from new to closed
  • Component changed from unfiled to selector
  • Milestone changed from None to 1.7

Appears to work as you've described in the latest jQuery-git version so it should be fixed in 1.7.

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


Add a comment

Modify Ticket

as closed

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

Note: See TracTickets for help on using tickets.