Skip to main content

Bug Tracker

Side navigation

#10224 closed bug (duplicate)

Opened September 07, 2011 09:54PM UTC

Closed September 07, 2011 10:50PM UTC

Last modified September 07, 2011 10:59PM UTC

wrong value for selector property on chained finds with comma in selector

Reported by: anonymous Owned by: anonymous
Priority: undecided Milestone: None
Component: selector Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:
Description

If I do:

var a = jQuery("table:first").find("tr").find('img,a')

I correctly get all the images and links in the rows of the first table.

However, the returned jQuery object has this as the value for its selector property:

console.log(a.selector); // "table:first tr img,a"

which is just a concatenation and would not return the same thing at all:

jQuery("table:first tr img,a")

Attachments (0)
Change History (8)

Changed September 07, 2011 10:00PM UTC by rwaldron comment:1

component: unfiledselector
owner: → anonymous
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/

Open the link and click to "Fork" (in the top menu) to get started.

Changed September 07, 2011 10:32PM UTC by anonymous comment:2

status: pendingnew

Here is the test:

http://jsfiddle.net/sf2Fn/3/

Changed September 07, 2011 10:38PM UTC by rwaldron comment:3

So, which part is not doing what is expected? http://gyazo.com/3048146e8db6b69e65a0fddd7e980c8e.png

Changed September 07, 2011 10:38PM UTC by rwaldron comment:4

status: newpending

Changed September 07, 2011 10:48PM UTC by anonymous comment:5

status: pendingnew

The second link should not be red, and the first link should read: "table img, table a" assuming the selector property has any meaning.

Changed September 07, 2011 10:50PM UTC by dmethvin comment:6

resolution: → duplicate
status: newclosed

Don't look at the .selector property, it's not documented to survive traversal methods and is only to be used internally.

Changed September 07, 2011 10:51PM UTC by dmethvin comment:7

Duplicate of #6754.

Changed September 07, 2011 10:59PM UTC by anonymous comment:8

Thanks!