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
[useSort] Add sort order custom sortMethod #1615
Conversation
Added sort order as parameter for calling sortMethod(will be useful to provide more control in custom sortMethod)
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 4add851:
|
The sort method here is always supposed to sort ascending. It's the responsibility of the |
To put full picture, here is the code
As a user, somebody may require special handling for |
So what I'm hearing here is that there are scenarios where you would always want certains values to be at the visual "bottom" end of a sort, regardless of the sort direction? |
Sort direction will matter between equal values(for stable sort), following are the snapshot of required output :- Column 1 is Image 1 - Image 2 -
|
Okay, I'm on board now. Good job everyone :) |
I'll merge this now, but we need to make sure we get the docs updated too :) |
The need for this prop just appeared to me, amazing to find it just merged. Thanks @tannerlinsley, thanks community!!! |
Added sort order as parameter for calling sortMethod(will be useful to provide more control in custom sortMethod)
Example :- To keep empty strings at bottom when sort in asc/desc order.