Skip to content

Handle sorting for "list" values #844

@justincorrigible

Description

@justincorrigible

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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions