-
-
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] Support the custom header filter height that is independent from the column header height #12643
Comments
@cherniavskii should we add this to the board to explore 2 separate props |
@michelengelen Thanks for the answer. It kind of works. But the header filter cell does not stretch to fit the height of the parent element. To fix this I had to add one more css rule sx={{
[`& .${gridClasses.columnHeader}`]: {
height: 40,
},
[`& .${gridClasses.headerFilterRow}`]: {
height: 52,
[`& .${gridClasses.columnHeader}`]: {
height: "100%!important",
},
},
}} |
But there is one problem with the current solution. Now it is possible to scroll the table content even there is enough space to fit all rows. You can see it in the attached video. I have mui-scrolling-issue.mov |
I am guessing this is because we overwrote dimensions only in the CSS, but the dimensions in the internal state were not adjusted accordingly, so features that depend on internal dimensions such as scrolling don't work as expected. |
That's because we use fake scrollbars internally and they use a function called getTotalHeaderHeight to compute when to start a scroll. Even if you increase the height using the mui-x/packages/x-data-grid/src/hooks/features/columns/gridColumnsUtils.ts Lines 432 to 441 in a1975c6
IMO introducing a separate optional prop like Since it will be kind of an override, I'd prefer not to take into account the Wdyt @mui/xgrid? |
Yes, |
Sounds good to me on a rethought. I was relating it more to a fixed height value (just like we set using CSS), but for an internal prop, I agree that honoring the density does make sense. |
@layerok: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Summary
Modify the behaviour of the
columnHeaderHeight
prop so that it no longer controls the height of the header filter row and only controls the height of the column header row.Add a new
columnHeaderFilterHeight
prop which controls the height of the header filter row.Examples
I have the following datagrid design in which the header filter height and the column header height are different. The header filter height is
52px
and the header column height is40px
Currently there is only one prop to control header row height. It is
columnHeaderHeight
. But this prop doesn't suit my needs, because it makes both rows the same height.My current workaround.
Motivation
There is no convenient way to change the height of the header filter independently from the height of the column header.
Search keywords: column header filter, custom height
Order ID: 74777
The text was updated successfully, but these errors were encountered: