diff --git a/packages/x-data-grid-pro/src/hooks/features/detailPanel/gridDetailPanelToggleColDef.tsx b/packages/x-data-grid-pro/src/hooks/features/detailPanel/gridDetailPanelToggleColDef.tsx index ce3a18b882aa..76e80c840299 100644 --- a/packages/x-data-grid-pro/src/hooks/features/detailPanel/gridDetailPanelToggleColDef.tsx +++ b/packages/x-data-grid-pro/src/hooks/features/detailPanel/gridDetailPanelToggleColDef.tsx @@ -29,5 +29,5 @@ export const GRID_DETAIL_PANEL_TOGGLE_COL_DEF: GridColDef = { return expandedRowIds.includes(rowId); }, renderCell: (params) => , - renderHeader: () => null, + renderHeader: ({ colDef }) =>
, }; diff --git a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderTitle.tsx b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderTitle.tsx index 11f99b8ac0c3..e1761b3f8304 100644 --- a/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderTitle.tsx +++ b/packages/x-data-grid/src/components/columnHeaders/GridColumnHeaderTitle.tsx @@ -36,7 +36,9 @@ const ColumnHeaderInnerTitle = React.forwardRef< HTMLDivElement, React.HTMLAttributes >(function ColumnHeaderInnerTitle(props, ref) { - const { className, ...other } = props; + // Tooltip adds aria-label to the props, which is not needed since the children prop is a string + // See https://github.com/mui/mui-x/pull/14482 + const { className, 'aria-label': ariaLabel, ...other } = props; const rootProps = useGridRootProps(); const classes = useUtilityClasses(rootProps); diff --git a/packages/x-data-grid/src/components/columnHeaders/GridGenericColumnHeaderItem.tsx b/packages/x-data-grid/src/components/columnHeaders/GridGenericColumnHeaderItem.tsx index 6e397e2aa408..412bb46be9a1 100644 --- a/packages/x-data-grid/src/components/columnHeaders/GridGenericColumnHeaderItem.tsx +++ b/packages/x-data-grid/src/components/columnHeaders/GridGenericColumnHeaderItem.tsx @@ -109,7 +109,6 @@ const GridGenericColumnHeaderItem = React.forwardRef(function GridGenericColumnH tabIndex={tabIndex} aria-colindex={colIndex + 1} aria-sort={ariaSort} - aria-label={headerComponent == null ? label : undefined} {...other} >
- Column grouping', () => { fireEvent.click(screen.getByRole('button', { name: /Update columns/ })); const row1Headers = document.querySelectorAll( - '[aria-rowindex="1"] [role="columnheader"]', + '[aria-rowindex="1"] [role="columnheader"] .MuiDataGrid-columnHeaderTitle', ); const row2Headers = document.querySelectorAll( - '[aria-rowindex="2"] [role="columnheader"]', + '[aria-rowindex="2"] [role="columnheader"] .MuiDataGrid-columnHeaderTitle', ); - expect( - Array.from(row1Headers).map((header) => header.getAttribute('aria-label')), - ).to.deep.equal(['Group']); - expect( - Array.from(row2Headers).map((header) => header.getAttribute('aria-label')), - ).to.deep.equal(['field_1']); + expect(Array.from(row1Headers).map((header) => header.textContent)).to.deep.equal(['Group']); + expect(Array.from(row2Headers).map((header) => header.textContent)).to.deep.equal([ + 'field_1', + ]); }); });