-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[DataGrid] Make column autosizing work with dynamic row height #10693
[DataGrid] Make column autosizing work with dynamic row height #10693
Conversation
Deploy preview: https://deploy-preview-10693--material-ui-x.netlify.app/ Updated pages: |
@romgrk What do you think? |
Looks ok, I feel like there's going to be edge-cases that we haven't thought of but if it works let's do it. |
@romgrk Yes, I thought we might avoid some edge cases if Another option would be for the data grid to automatically limit the column width to not exceed the grid width when dynamic row height is being used. |
Recommending I woudn't do the other option but I'm not opposed to it. |
1fdc8e4
to
3b6d61b
Compare
This comment was marked as resolved.
This comment was marked as resolved.
[`& .${gridClasses.cell} > *`]: { | ||
overflow: 'visible !important', | ||
whiteSpace: 'nowrap', | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We know what to whitespace: nowrap
because we assume a certain layout for the cells, but for custom rendered cells this might not work. There is no general solution to that though, let's just wait until someone has that problem.
Exploration of #10669
Demo: https://codesandbox.io/s/vigilant-bouman-57jg8d?file=/src/demo.tsx
It doesn't work great with calling
autosizeColumns
on resize, but it might be feasible for double-click autosizing.Preview: https://deploy-preview-10693--material-ui-x.netlify.app/x/react-data-grid/column-dimensions/#autosizing-with-dynamic-row-height