Skip to content
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

Handle sorting for "list" values #844

Open
justincorrigible opened this issue Aug 10, 2023 · 0 comments
Open

Handle sorting for "list" values #844

justincorrigible opened this issue Aug 10, 2023 · 0 comments
Assignees

Comments

@justincorrigible
Copy link
Member

When you click on any column header to sort the rows, depending on which column you select, the first time you click that column you’ll get a mixed result of ascending or descending as the outcome.
Turns out this is caused by some shortsighted/opinionated logic within react-table (as seen here https://github.com/TanStack/table/blob/main/packages/table-core/src/features/Sorting.ts#L166), where unless you specify all/any columns should be be sorted first in a specific manner, it choses a default based on whether the value is a plain string or not.

This of course doesn’t work in our usual data models, where though some values show as a string, they come as arrays of strings instead (because we support lists of values), generating the inconsistent behaviour.

I’m adding a default “all columns sort as ascending first” in Arranger (V3 beta 34), but lists require better handling, so I’m creating a ticket to address one later in detail.

@justincorrigible justincorrigible self-assigned this Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant