-
-
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] Get correct width for invisible iconContainer
#16399
Conversation
Deploy preview: https://deploy-preview-16399--material-ui-x.netlify.app/ |
Instead of all of this, you can also just remove these styles They are actually hiding the icon while autosizing which makes the icon container width @mui/xgrid anyone else knows if we need them for something else? Quick UI test didn't show me anything wrong after removing it and autosize includes the active sort icon |
Sry for the inconvenience, but I did check the suggestion from @arminmeh and could not find a case where that was not working, so I instead applied that, since it is cleaner. If we can make this into the release of v7 (when cherry-picking is done) that would be awesome! |
Cherry-pick PRs will be created targeting branches: v7.x |
Fixes #15388
This is a fix to get the
scrollWidth
instead of theclientWidth
when the column has sorting applied. This is to calculate the columns width on autosize. Previously it was not respecting the sorting button.The problem before was that we get the
headerContainer
from the ref stored in theapiRef
which was not holding the current state (and thereforevisibility
) of the sorting button. This resulted in the value stored inclientWidth
to always be0
.For the fix I would much rather rely on the sortModelLookup, but since this is outside of a component or hook we cannot use the grids selectors.
Any ideas how to improve this are welcome!