Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ function GridToolbar(props: GridToolbarProps) {

{showExportMenu && (
<React.Fragment>
<rootProps.slots.baseTooltip title={apiRef.current.getLocaleText('toolbarExport')}>
<rootProps.slots.baseTooltip
title={apiRef.current.getLocaleText('toolbarExport')}
disableInteractive={exportMenuOpen}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit concerned about the accessibility guidelines here.

By disabling interaction, I think I'm breaking the "Hoverable" section, which states: "if pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing". Since the user can hover over the button and the tooltip will show, then it should be possible to move the pointer over the tooltip content without it disappearing.

An alternative would be to disableHoverListener when the menu is open, but that would break the "persistent" section, which states that "the additional content remains visible until the hover or focus trigger is removed, [...]". If the user opens the menu using the mouse, then they're still hovering the button, so the tooltip should remain visible.

Unless what they mean is that "if you opened the button with a hover, but the button loses the focus, then it's also acceptable to close the tooltip". If that's the case, then I think we could use disableHoverListener without breaking the accessibility guidelines.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to say which is better, but I think what you have now is a good solution.

>
<ToolbarButton
ref={exportMenuTriggerRef}
id={exportMenuTriggerId}
Expand Down
1 change: 1 addition & 0 deletions packages/x-data-grid/src/models/gridBaseSlots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ export type TooltipProps = CommonProps & {
children: React.ReactElement<any, any>;
enterDelay?: number;
title: React.ReactNode;
disableInteractive?: boolean;
};

export type IconProps = CommonProps<SVGSVGElement> & {
Expand Down