Skip to main content

Bug Tracker

Side navigation

#7322 closed bug (fixed)

Opened October 26, 2010 09:58PM UTC

Closed April 17, 2011 05:53PM UTC

Last modified October 19, 2011 03:00PM UTC

basic filter pseudo-selectors function strangely when used with .parents

Reported by: ijames@hearsaylabs.com Owned by:
Priority: low Milestone:
Component: selector Version: 1.4.3
Keywords: eq even first gt last lt odd Cc:
Blocked by: Blocking:
Description

Color-prefixed selectors always search 'down' the DOM tree (toward leaves). In some instances this may be incorrect, such as within the

 .parents 
function.

For example,

 elem.parents(sel :selected) 
will return a selected option tag whose parent select node is a parent to elem matching the selector, instead of selecting a parent node which both matches the selector and is selected.

Here's some code: http://jsfiddle.net/dw6zP/

Attachments (0)
Change History (4)

Changed October 27, 2010 12:18AM UTC by snover comment:1

component: unfiledtraversing
keywords: → eq even first gt last lt odd
milestone: 1.5
priority: undecidedlow
status: newopen
summary: colon selector search directionbasic filter pseudo-selectors function strangely when used with .parents

improved test case

This issue has existed since at least 1.3.

Changed April 17, 2011 05:53PM UTC by john comment:2

component: traversingselector
resolution: → worksforme
status: openclosed

This is the expected behavior. Positional selectors (like :first, :last) behave differently from other selectors (like :first-child, for example).

Changed September 20, 2011 03:51AM UTC by Dave Methvin comment:3

resolution: worksformefixed

Landing pull request 491. Fix #7322. Make .is() with a positional selector work like delegated event logic. Fixes #7322.

More Details:

Changeset: 70e2e32e0eb03607ad0c8b7752dbd7747da47164

Changed October 19, 2011 03:00PM UTC by timmywil comment:4

#10535 is a duplicate of this ticket.