KevinVandy/material-react-table

sort on null value

Grummfy opened this issue · 3 comments

material-react-table version

2.12.1

react & react-dom versions

17.0.2

Describe the bug and the steps to reproduce it

  • value null (from accessorFn)
  • sort manual (server side)

The sort indicator move in two state and not three (ascending, no sort, instead of ascending, descending, no sort)

Minimal, Reproducible Example - (Optional, but Recommended)

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

You're looking for sortUndefined? Although, if you are using manualSorting, that's up to you to implement the correct sorting logic on your back-end APIs.

https://tanstack.com/table/latest/docs/guide/sorting#sort-undefined-values

The problem is that manual sorting or not, it change nothing since the value are not properly defined in the sort state. And the sort state is what is send to the back

I don't think I follow