Skip to content

Commit

Permalink
[DataGrid] Wrap column menu button with a tooltip (#7890)
Browse files Browse the repository at this point in the history
  • Loading branch information
cherniavskii committed Apr 5, 2023
1 parent decf45c commit 06dcac2
Showing 1 changed file with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,27 @@ export const ColumnHeaderMenuIcon = React.memo((props: ColumnHeaderMenuIconProps

return (
<div className={classes.root}>
<rootProps.slots.baseIconButton
ref={iconButtonRef}
tabIndex={-1}
className={classes.button}
aria-label={apiRef.current.getLocaleText('columnMenuLabel')}
<rootProps.slots.baseTooltip
title={apiRef.current.getLocaleText('columnMenuLabel')}
size="small"
onClick={handleMenuIconClick}
aria-expanded={open ? 'true' : undefined}
aria-haspopup="true"
aria-controls={columnMenuId}
id={columnMenuButtonId}
{...rootProps.slotProps?.baseIconButton}
enterDelay={1000}
{...rootProps.slotProps?.baseTooltip}
>
<rootProps.slots.columnMenuIcon fontSize="small" />
</rootProps.slots.baseIconButton>
<rootProps.slots.baseIconButton
ref={iconButtonRef}
tabIndex={-1}
className={classes.button}
aria-label={apiRef.current.getLocaleText('columnMenuLabel')}
size="small"
onClick={handleMenuIconClick}
aria-expanded={open ? 'true' : undefined}
aria-haspopup="true"
aria-controls={columnMenuId}
id={columnMenuButtonId}
{...rootProps.slotProps?.baseIconButton}
>
<rootProps.slots.columnMenuIcon fontSize="small" />
</rootProps.slots.baseIconButton>
</rootProps.slots.baseTooltip>
</div>
);
});

0 comments on commit 06dcac2

Please sign in to comment.