Skip to main content

Bug Tracker

Side navigation

#12673 closed bug (fixed)

Opened October 08, 2012 10:05AM UTC

Closed October 08, 2012 04:30PM UTC

Wrong result when a selection is scoped using both the selector and the context param (or using find)

Reported by: chab@official.fm Owned by:
Priority: undecided Milestone: 1.8
Component: selector Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

var parent = $("#parent");

$("#parent .child1, #parent .child2") => 2 elements = OK

$("#parent .child1, #parent .child2", parent) => 1 element ?

parent.find("#parent .child1, #parent .child2") => 1 element?

It should return 0 or 2 elements , but 1 element doesn't make sense. Reproduce on: https://github.com/jquery/sizzle/issues/160

Attachments (0)
Change History (2)

Changed October 08, 2012 11:25AM UTC by chab@official.fm comment:1

jsFiddle is here: http://jsfiddle.net/GRbHA/3

Changed October 08, 2012 04:30PM UTC by gibson042 comment:2

component: unfiledselector
milestone: None1.8
resolution: → fixed
status: newclosed

jQuery 1.8.x and edge find no elements with either $("#parent .child1, #parent .child2", parent) or parent.find("#parent .child1, #parent .child2").