-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
Describe the bug
When you have less than 10 records and for a column if sortingFn is 'auto' which is default. The sorting does not work correctly.
This is happening because of this line in the code:
table-core/src/features/Sorting.ts
getAutoSortingFn: () => {
const firstRows = table.getFilteredRowModel().flatRows.slice(10)
...
}
This should have been:
const firstRows = table.getFilteredRowModel().flatRows.slice(0, 10)
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/optimistic-shadow-3z2j6c?file=%2Fsrc%2FmakeData.ts%3A1%2C1
Steps to reproduce
Check the sorting on the Status column
Expected behavior
The Status column should be sorted correctly.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Windows with Chrome
react-table version
v8.9.2
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
rvardy-citco, supagu, starwilly, MbBrainz, mjewell and 4 more
Metadata
Metadata
Assignees
Labels
No labels