🌐 AI搜索 & 代理 主页
Skip to content

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

  • New tests have been added to show the fix or feature works
  • Grunt build and unit tests pass locally with these changes
  • If needed, a docs issue/PR was created at https://github.com/jquery/api.jquery.com

@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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

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

3 participants