Skip to content

Selector: Implement the uniqueSort chainable method #5168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

mgol
Copy link
Member

@mgol mgol commented Nov 24, 2022

Summary

Some APIs, like .prevAll(), return elements in the reversed order, causing confusing behavior when used with wrapping methods (see gh-5149 for more info)
To provide an easy workaround, this commit implements a chainable uniqueSort
method on jQuery objects, an equivalent of jQuery.uniqueSort.

Fixes gh-5166

+12 bytes

Checklist

Sorry, something went wrong.

@mgol mgol added this to the 4.0.0 milestone Nov 24, 2022
@mgol mgol self-assigned this Nov 24, 2022
@mgol mgol force-pushed the uniqueSort-method branch from 9fa3e39 to 59fccb8 Compare November 24, 2022 23:27
Some APIs, like `.prevAll()`, return elements in the reversed order, causing
confusing behavior when used with wrapping methods (see jquerygh-5149 for more info)
 To provide an easy workaround, this commit implements a chainable `uniqueSort`
method on jQuery objects, an equivalent of `jQuery.uniqueSort`.

Fixes jquerygh-5166
@mgol mgol force-pushed the uniqueSort-method branch from 59fccb8 to f43b660 Compare November 25, 2022 11:38
@mgol mgol merged commit 5266f23 into jquery:main Nov 28, 2022
@mgol mgol deleted the uniqueSort-method branch November 28, 2022 17:11
mgol added a commit to mgol/jquery that referenced this pull request Dec 14, 2022
Some APIs, like `.prevAll()`, return elements in the reversed order, causing
confusing behavior when used with wrapping methods (see jquerygh-5149 for more info)
 To provide an easy workaround, this commit implements a chainable `uniqueSort`
method on jQuery objects, an equivalent of `jQuery.uniqueSort`.

Fixes jquerygh-5166
Closes jquerygh-5168

(cherry picked from commit 5266f23)
@mgol mgol modified the milestones: 4.0.0, 3.7.0 Dec 14, 2022
@mgol
Copy link
Member Author

mgol commented Dec 14, 2022

Landed on main in 5266f23 and on 3.x-stable in 0acbe64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Selector: Implement uniqueSort, a chainable method version of jQuery.uniqueSort
3 participants