Replies: 5 comments 9 replies
|
@tannerlinsley Huge fan of your libraries, thanks for all these contributions. Having undefined values at the bottom of the list regardless of the direction is a reasonable need, yet I believe it is not possible to achieve it easily with the custom sorting functions as of now. Exposing the sort direction seems like a simple yet useful addition that would solve this issue, would you be open to a PR for this? |
|
I was reading some old issues like #2371, it seems the direction was part of the function signature. It would be great if we could bring it back. |
|
The sortEntry has id and desc however only id is being passed to the sortingFn. It would be very helpful if desc was passed in as well. However a workaround would be doing something like const isColumnSortedDesc = <T,>(column: Row, prop: string) => { const sortUndefinedAtBottom = (value1: number | undefined, value2: number | undefined, isSortedDesc: boolean) => { }; |
|
Hi! In case you want to sort columns with range values, for example [241, 567], and for ascending I would like to compare rows by 1st value (241), but for descending by last (567). It is not possible to write a custom sorting function to achieve that without having |
|
Just wanted to note related issues and discussions on sortingFn vs direction topic:
|
Uh oh!
There was an error while loading. Please reload this page.
We have cases where we want certain values to always be sorted at the end despite of sort direction.
This can be achieved by passing the column sort direction to a custom sorting function, where we can treat this case.
Eg, have
SortingFn's signature be:It seems this could help other users too (#3300).
Thank you!
All reactions