Opened 15 years ago
Closed 15 years ago
#1449 closed bug (fixed)
parent method return duplicate elements
Reported by: | blairmitchelmore | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.1.4 |
Component: | core | Version: | 1.1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When you have multiple elements from the same parent elements in a jQuery array and then call parent, the resultant jQuery array contains multiple references to the same element.
Test case found at http://jquery.offput.ca/tests/parent.php
The page will alert '6' and it should alert '1'
Attachments (1)
Note: See
TracTickets for help on using
tickets.
I've fixed the bug (if it is a bug and not a "feature") but simply calling jQuery.unique inside the .parent() method.
I don't see any major consequences from this and it would be an easy patch for jQuery core. (Of course you could also patch pushStack to ensure things are unique, but that could be overkill.)