Skip to content

Commit

Permalink
[DataGrid] Remove cell min-width / max-width styles (mui#14448)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored Sep 2, 2024
1 parent a32e9d5 commit 315ffa1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ const GridHeaderFilterCell = React.forwardRef<HTMLDivElement, GridHeaderFilterCe
style={{
height,
width,
minWidth: width,
maxWidth: width,
...styleProp,
}}
role="columnheader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ const GridGenericColumnHeaderItem = React.forwardRef(function GridGenericColumnH
...style,
height,
width,
minWidth: width,
maxWidth: width,
}}
role="columnheader"
tabIndex={tabIndex}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,7 @@ export const GridRootStyles = styled('div', {
/* Cell styles */
[`& .${c.cell}`]: {
height: 'var(--height)',
minWidth: 'var(--width)',
maxWidth: 'var(--width)',
width: 'var(--width)',
lineHeight: 'calc(var(--height) - 1px)', // -1px for the border

boxSizing: 'border-box',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,10 @@ export const useGridColumnResize = (
refs.colDef!.flex = 0;

refs.columnHeaderElement!.style.width = `${newWidth}px`;
refs.columnHeaderElement!.style.minWidth = `${newWidth}px`;
refs.columnHeaderElement!.style.maxWidth = `${newWidth}px`;

const headerFilterElement = refs.headerFilterElement;
if (headerFilterElement) {
headerFilterElement.style.width = `${newWidth}px`;
headerFilterElement.style.minWidth = `${newWidth}px`;
headerFilterElement.style.maxWidth = `${newWidth}px`;
}

refs.groupHeaderElements!.forEach((element) => {
Expand All @@ -335,8 +331,6 @@ export const useGridColumnResize = (
}

div.style.width = finalWidth;
div.style.minWidth = finalWidth;
div.style.maxWidth = finalWidth;
});

refs.cellElements!.forEach((element) => {
Expand Down Expand Up @@ -427,8 +421,6 @@ export const useGridColumnResize = (
const finalWidth: `${number}px` = `${newWidth}px`;

div.style.width = finalWidth;
div.style.minWidth = finalWidth;
div.style.maxWidth = finalWidth;
});
}

Expand Down

0 comments on commit 315ffa1

Please sign in to comment.