Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11385 closed bug (duplicate)

parents() orders each tier of results back-to-front

Reported by: wheresrhys Owned by:
Priority: low Milestone: None
Component: traversing Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:

Description

Not sure if this counts as a bug, but when finding parents of a collection of more than one element the resulting collection has the parents in a back-to-front order at each tier.

e.g.

<div class="div1"><span></span></div><div class="div2"><span></span></div>

$("span").parents() // [div2, div1, body, html]
                    // expected [div1, div2, body, html]

http://jsfiddle.net/vkGEQ/

Change History (2)

comment:1 Changed 7 years ago by sindresorhus

Component: unfiledtraversing
Keywords: needsdocs added
Priority: undecidedlow
Status: newopen

This is by design, but the docs should mention it.

comment:2 Changed 7 years ago by timmywil

Keywords: needsdocs removed
Resolution: duplicate
Status: openclosed
Note: See TracTickets for help on using tickets.