openfun / cunningham

🎨 The Open FUN Design System
https://openfun.github.io/cunningham/
MIT License
23 stars 2 forks source link

DataGrid / DataList - enableSorting enable by default #320

Open jbpenrath opened 7 months ago

jbpenrath commented 7 months ago

On DataGrid / DataList components, the sorting is enabled by default. But if this prop is true but no sortModel is provided a warning is raised.

Should we disable enableSorting by default ?

https://github.com/openfun/cunningham/blob/b4a6367bce2984ac4d671f262faccfbb6204a0b5/packages/react/src/components/DataGrid/index.tsx#L97

e.g: Warning raised during tests

stderr | src/components/DataGrid/index.spec.tsx > <DataGrid/> > should render custom cells
You are using a column with sorting enabled, but you are not providing an `onSortModelChange` handler. The sorting will not work as expected.
You are using a column with sorting enabled, but you are not providing an `onSortModelChange` handler. The sorting will not work as expected.
You are using a column with sorting enabled, but you are not providing an `onSortModelChange` handler. The sorting will not work as expected.
You are using a column with sorting enabled, but you are not providing an `onSortModelChange` handler. The sorting will not work as expected.