Bug Tracker

Modify

Ticket #3850 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

.find('>') fails in jq 1.3

Reported by: StaticShock Owned by: john
Priority: major Milestone: 1.3.1
Component: selector Version: 1.3
Keywords: children selector Cc:
Blocking: Blocked by:

Description

this used to be a valid selector in 1.2.6, equivalent to .children()

here's a test case:

javascript:alert($('div').find('>').length);void(0)

Milestone: 1.3.1 Version: 1.3

Change History

comment:1 Changed 4 years ago by john

  • Status changed from new to closed
  • Version set to 1.3
  • Resolution set to wontfix
  • Milestone set to 1.3.1

I don't think we can guarantee that being a valid selector, thankfully we have a drop-in replacement. Instead of .find('>') just do:

  .children()

comment:2 Changed 4 years ago by StaticShock

yes, but a query such as:

.find('>:last div').end()

now turns into:

.children(':last').find('div').end().end()

which is hardly as pleasant as it used to be in 1.2.6

comment:3 Changed 4 years ago by StaticShock

also, it can't be used as easily with other selectors. for instance, take a stab at re-writing this valid 1.2.6 code:

.find('>.deviceChooser>.remButton,>.addButtonContainer>.customAddButton')

comment:4 Changed 4 years ago by john

I think there's some confusion here. .find("> div") works (or should work). I'm saying that .find(">") should not work.

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.