Using remote data.
orderBy and orderDirection (_asc_)orderBy and incorrect orderDirection (_asc again, should be desc now_)orderBy (_should be null_) and incorrect orderDirection (desc, should be null now because it is third time I click sort)Logs screen:

Material-table version: 1.69.0
I'm also suffering from this issue
this is also the case is for the pagination and the search
Could you comment on this @mbrn ?
Ditto, I have the same problem. Waiting for response, thanks!
Actually i'm finding this table is totally useless.lot of issues are not resolving.there is problem with search also..
Also been having this issue for a while now.
I solved it with setting defaultSort for each field.
const [filter, setFilter] = useState({ field: "name", order: "asc" })
...
<MaterialTable
columns={[
{
field: "name",
title: "name",
defaultSort: sortField.order,
]}
/>
However, it has some drawbacks. When you change state, material table sorts your current data by order you provided, so there is glimpse of data visually getting sorted twice. You may change order state after your data is loaded as well to avoid such behaviour.
Not stale
I solved it with setting
defaultSortfor each field.
const [filter, setFilter] = useState({ field: "name", order: "asc" }) ... <MaterialTable columns={[ { field: "name", title: "name", defaultSort: sortField.order, ]} />
However, it has some drawbacks. When you change state, material table sorts your current data by order you provided, so there is glimpse of data visually getting sorted twice. You may change order state after your data is loaded as well to avoid such behaviour.
where does sortField come from ?
Most helpful comment
Not stale