Skip to content

Commit 2b0cf16

Browse files
committed
decide to use a longer opening delay for the first time and use a tradeoff for the default values
1 parent 3ca5705 commit 2b0cf16

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/components/Tooltip/Tooltip.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ export interface TooltipProps extends Omit<BlueprintTooltipProps, "position"> {
4343
*/
4444
usePlaceholder?: boolean;
4545
/**
46-
* Time after the placeholder element is replaced by the actual tooltip component. Must be greater than 0.
46+
* Time after the placeholder element is replaced by the actual tooltip component.
47+
* Must be greater than 0.
48+
* For the first display of the tooltip this time adds up to `hoverOpenDelay`.
4749
*/
4850
swapPlaceholderDelay?: number;
4951
}
@@ -58,7 +60,7 @@ export const Tooltip = ({
5860
markdownProps,
5961
usePlaceholder,
6062
swapPlaceholderDelay = 100,
61-
hoverOpenDelay = 500,
63+
hoverOpenDelay = 450,
6264
...otherTooltipProps
6365
}: TooltipProps) => {
6466
const placeholderRef = React.useRef(null);
@@ -176,9 +178,7 @@ export const Tooltip = ({
176178
) : (
177179
<BlueprintTooltip
178180
lazy={true}
179-
hoverOpenDelay={
180-
swapDelayTime > 0 && hoverOpenDelay > swapDelayTime ? hoverOpenDelay - swapDelayTime : hoverOpenDelay
181-
}
181+
hoverOpenDelay={hoverOpenDelay}
182182
{...otherTooltipProps}
183183
content={tooltipContent}
184184
className={targetClassName}

0 commit comments

Comments
 (0)