-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] autosizeOnMount
is broken on 7.23.1
#15856
Comments
autosizeOnMount
is broken on 7.23.1
I don't think this has something to do with autosizing. Before 7.23.1, column autosizing ignored flex columns – this is the reason they fill the full width of the container, regardless of
This is expected behavior. By default, autosizing doesn't try to fill the full width of the data grid, it measures the cell content and sets the column width for the content to fit. |
fwiw, my team ran into this today after jumping from version 7.17.0 to 7.23.2. We had been using Whether the behavior before was broken and is now fixed, or whether a regression was introduced here, I can't really comment on, but either way something that was working for us stopped working. It's not entirely clear from the documentation how all these fields interact. I'm sure that the first time we implemented the datagrid we just stole some example from somewhere without fully understanding each field, got the behavior we wanted, and moved on 😄 After adding Anyway, I hope this helps anyone else who runs into this, and provides a bit of context as to where the confusion might be coming from. |
The Much the same as @tobalsgithub has mentioned, we've got the flex columns and
This seems like a breaking change? I'm happy that there is a solution (setting I wasn't able to find any docs explaining what the possible values of the |
Good point @tim-mit ... I'll add this to the board for the team to check if a note about that could be added. |
Steps to reproduce
Steps:
Current behavior
When using
autosizeOnMount
the column widths are not correctly calculated, and the width of the container isn't covered.Expected behavior
On previous versions, e.g.
7.20.0
, the columns would fill the width of the container.Context
The columns should be equally spaced out using the flex rules across the width of the container.
Your environment
npx @mui/envinfo
I've tested on Chrome and Safari, the same behaviour occurs on both.
Search keywords: datagrid autosizeOnMount
Order ID: 103743
The text was updated successfully, but these errors were encountered: