@dbcdk/react-components 0.0.84 → 0.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useCallback, useContext, useEffect, useId, useRef, useState } from 'react';
|
|
2
|
-
import { MOTION_MS } from '../../../styles/animation';
|
|
3
2
|
import { TooltipContext } from './TooltipProvider';
|
|
4
3
|
export function useTooltipTrigger(options) {
|
|
5
4
|
const ctx = useContext(TooltipContext);
|
|
@@ -92,10 +91,9 @@ export function useTooltipTrigger(options) {
|
|
|
92
91
|
return;
|
|
93
92
|
const shouldOpen = focusOpenMode === 'any' || e.currentTarget.matches(':focus-visible');
|
|
94
93
|
// By default we only show for keyboard focus. Callers can opt into opening on any focus.
|
|
95
|
-
if (!isControlled && shouldOpen)
|
|
96
|
-
setTimeout(() =>
|
|
97
|
-
|
|
98
|
-
}, MOTION_MS.tooltipOpen);
|
|
94
|
+
if (!isControlled && shouldOpen) {
|
|
95
|
+
openTimer.current = window.setTimeout(() => setOpen(true), delayOpenMs);
|
|
96
|
+
}
|
|
99
97
|
};
|
|
100
98
|
const onBlur = () => {
|
|
101
99
|
clearTimers();
|