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

number column in some group conditions sorts by first digit, not by number #417

Open
francis-vila opened this issue Apr 12, 2024 · 2 comments

Comments

@francis-vila
Copy link

When using grouped columns, in some combinations sorting numbers arranges them sorted by digit 'alphabetical' order, for example for an upward sort 11111, then 22, then 333, then 4444444, etc.

More specifically, it's when other columns are grouped and one column is not part of any group.

Open this sandbox and click on the last column CCCCC to see the effect:
https://codesandbox.io/p/sandbox/reactdatatable-issue-g9hd42?file=%2Fsrc%2FApp.js%3A377%2C51

Note that if you add

group: "other",

to line 395, the sort works as expected

@LeadDreamer
Copy link

your column "CCCCC" is not declared as type: "number" - so it defaults to a lexical sort. Tested using your codesandbox.

@francis-vila
Copy link
Author

Silly me... Thanks for answering anyway.

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

2 participants