Skip to content

Commit 0b9000b

Browse files
authored
fix(toolbar): show hint in ToolbarButton tooltip (#311)
1 parent 431685c commit 0b9000b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/toolbar/ToolbarButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const ToolbarButtonView = React.forwardRef<HTMLElement, ToolbarButtonView
3030
{
3131
icon,
3232
title,
33+
hint,
3334
hotkey,
3435
disabledPopoverVisible = true,
3536
hintWhenDisabled,
@@ -42,6 +43,7 @@ export const ToolbarButtonView = React.forwardRef<HTMLElement, ToolbarButtonView
4243
) {
4344
const disabled = !active && !enabled;
4445
const titleText: string = isFunction(title) ? title() : title;
46+
const hintText: string | undefined = isFunction(hint) ? hint() : hint;
4547
const hideHintWhenDisabled =
4648
hintWhenDisabled === false || !disabledPopoverVisible || !disabled;
4749
const hintWhenDisabledText =
@@ -61,6 +63,7 @@ export const ToolbarButtonView = React.forwardRef<HTMLElement, ToolbarButtonView
6163
<ActionTooltip
6264
openDelay={ToolbarTooltipDelay.Open}
6365
closeDelay={ToolbarTooltipDelay.Close}
66+
description={hintText}
6467
title={titleText}
6568
hotkey={hotkey}
6669
>

0 commit comments

Comments
 (0)