Bug Tracker

Modify

Ticket #10224 (closed bug: duplicate)

Opened 21 months ago

Last modified 21 months ago

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:
Blocking: Blocked by:

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")

Change History

comment:1 Changed 21 months ago by rwaldron

  • Owner set to anonymous
  • Status changed from new to pending
  • Component changed from unfiled to selector

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.

comment:2 Changed 21 months ago by anonymous

  • Status changed from pending to new

Here is the test:  http://jsfiddle.net/sf2Fn/3/

comment:3 Changed 21 months ago by rwaldron

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

comment:4 Changed 21 months ago by rwaldron

  • Status changed from new to pending

comment:5 Changed 21 months ago by anonymous

  • Status changed from pending to new

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

comment:6 Changed 21 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

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

comment:7 Changed 21 months ago by dmethvin

Duplicate of #6754.

comment:8 Changed 21 months ago by anonymous

Thanks!

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.