Side navigation
#10562 closed bug (fixed)
Opened October 23, 2011 12:17PM UTC
Closed October 23, 2011 03:00PM UTC
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: | ||
Blocked by: | Blocking: |
Description
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> <div> <span></span> </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
Attachments (0)
Change History (1)
Changed October 23, 2011 03:00PM UTC by comment:1
component: | unfiled → selector |
---|---|
milestone: | None → 1.7 |
priority: | undecided → low |
resolution: | → fixed |
status: | new → closed |
Appears to work as you've described in the latest jQuery-git version so it should be fixed in 1.7.