Skip to main content

Bug Tracker

Side navigation

#3850 closed bug (wontfix)

Opened January 14, 2009 08:11PM UTC

Closed January 15, 2009 01:52PM UTC

Last modified January 15, 2009 03:49PM UTC

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

Attachments (0)
Change History (4)

Changed January 15, 2009 01:52PM UTC by john comment:1

milestone: → 1.3.1
resolution: → wontfix
status: newclosed
version: → 1.3

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

Changed January 15, 2009 03:23PM UTC by StaticShock comment:2

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

Changed January 15, 2009 03:31PM UTC by StaticShock comment:3

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

Changed January 15, 2009 03:49PM UTC by john comment:4

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