[DataGrid] cell content not consistently center aligned #12943
Labels
component: data grid
This is the name of the generic UI component, not the React module!
v7.x migration
Steps to reproduce
Link to live example: https://stackblitz.com/edit/react-eteo2e?file=Demo.tsx
Steps:
DataGrid
component and at least one column with therenderCell
property defined.renderCell
property is not centered vertically compared to other cells.Current behavior
The content of
renderCell
is not centered vertically compared to other cells.Expected behavior
The content of
renderCell
should be centered vertically to align with other cells.Context
When upgrading a project from DataGrid 6 to 7, there were a number of DataGrid usages that had noticeable visual regressions. These regressions appear to be caused by a change in how
renderCell
content is rendered. Specifically, the content ofrenderCell
is no longer always vertically aligned with other cells in the DataGrid.However, this doesn't necessarily seem to be limited to
renderCell
. You can tell by comparing the v6 documentation to v7, where this issue also exists with thegetRowHeight
prop:Upon further comparisons, it looks like some cell styles in v7 are being overridden by the user agent stylesheet.
Your environment
npx @mui/envinfo
Search keywords: datagrid, renderCell, center, getRowHeight
The text was updated successfully, but these errors were encountered: