[data grid] Autosizing does not work if there are less than 4 rows #16311
Labels
bug 🐛
Something doesn't work
component: data grid
This is the name of the generic UI component, not the React module!
feature: Column resize
Steps to reproduce
Steps:
Interesting thing here is that if there are 4 rows or more, then toggling options on/off and clicking autosize works perfectly. I froze the stackblitz project but you can test this as well using the demo example in the docs.
Docs: https://mui.com/x/react-data-grid/column-dimensions/#autosizing
In the Autosizing demo example, click "Edit in Stackblitz" or "Edit in Codesandbox".
If it's of any help, same issue happens with latest v6 version as well.
Current behavior
With 3 rows or less, if
includeHeaders
is set totrue
while all the other options arefalse
, autosizing still behaves likeincludeOutliers
istrue
. Then when you setincludeHeaders
back tofalse
and autosize, cell content does not shrink.Expected behavior
With 3 rows or less, if
includeHeaders
is set totrue
while all the other options arefalse
, autosizing should only take header widths in the calculation. Then when you set it back tofalse
, columns should shrink back to original size.Context
No response
Your environment
Tried this in docs demo.
Search keywords: autosizing, datagrid
The text was updated successfully, but these errors were encountered: