Bug Tracker

Modify

Ticket #10607 (closed bug: invalid)

Opened 19 months ago

Last modified 19 months ago

$.parentsUntil matches partial class names

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.6.4
Keywords: Cc:
Blocking: Blocked by:

Description

Consider structure:

<div class="foo">

<div class="fooBar">

<div id="awol"></div>

</div>

</div>

$('#awol').parentsUntil('.foo'); won't match the outernmost .foo but the inner .fooBar element.

Example:

 http://pastebin.com/mQ1Q8EE9

Change History

comment:1 Changed 19 months ago by dmethvin

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

The description for  http://api.jquery.com/parentsUntil/ says:

Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.

... but not including ...

So yes it did find the outermost parent, but per its documented behavior did not return it in the matched set.

The forum community can provide more info about selectors:  http://forum.jquery.com/

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.