Bug Tracker

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#7322 closed bug (fixed)

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

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


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/

Change History (4)

comment:1 Changed 6 years ago by snover

  • Component changed from unfiled to traversing
  • Keywords eq even first gt last lt odd added
  • Milestone 1.5 deleted
  • Priority changed from undecided to low
  • Status changed from new to open
  • Summary changed from colon selector search direction to basic filter pseudo-selectors function strangely when used with .parents

improved test case

This issue has existed since at least 1.3.

comment:2 Changed 5 years ago by john

  • Component changed from traversing to selector
  • Resolution set to worksforme
  • Status changed from open to closed

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

comment:3 Changed 5 years ago by Dave Methvin

  • Resolution changed from worksforme to fixed

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

More Details:

comment:4 Changed 5 years ago by timmywil

#10535 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.