Tooltip: Improve accessibility for context menus (#12462)
* Update `ContextMenuTooltipButton.tsx` * Fix placement * Update tests * Update space panel snapshot * Remove default placement * Update snapshots * Fix tooltip child rerender * Remove useless props title
This commit is contained in:
parent
580bc8771c
commit
bec8fdb3d3
3 changed files with 14 additions and 7 deletions
|
@ -106,6 +106,11 @@ type Props<T extends keyof JSX.IntrinsicElements> = DynamicHtmlElementProps<T> &
|
|||
* Callback for when the tooltip is opened or closed.
|
||||
*/
|
||||
onTooltipOpenChange?: TooltipProps["onOpenChange"];
|
||||
|
||||
/**
|
||||
* Whether the tooltip should be disabled.
|
||||
*/
|
||||
disableTooltip?: TooltipProps["disabled"];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -140,6 +145,7 @@ const AccessibleButton = forwardRef(function <T extends keyof JSX.IntrinsicEleme
|
|||
caption,
|
||||
placement = "right",
|
||||
onTooltipOpenChange,
|
||||
disableTooltip,
|
||||
...restProps
|
||||
}: Props<T>,
|
||||
ref: Ref<HTMLElement>,
|
||||
|
@ -217,6 +223,7 @@ const AccessibleButton = forwardRef(function <T extends keyof JSX.IntrinsicEleme
|
|||
isTriggerInteractive={true}
|
||||
placement={placement}
|
||||
onOpenChange={onTooltipOpenChange}
|
||||
disabled={disableTooltip}
|
||||
>
|
||||
{button}
|
||||
</Tooltip>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue