Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3347720
D4910.id16052.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4910.id16052.diff
View Options
diff --git a/web/chat/tooltip-provider.js b/web/chat/tooltip-provider.js
--- a/web/chat/tooltip-provider.js
+++ b/web/chat/tooltip-provider.js
@@ -6,6 +6,7 @@
import type { TooltipPositionStyle } from './tooltip-utils';
const onMouseLeaveSourceDisappearTimeoutMs = 200;
+const onMouseLeaveTooltipDisappearTimeoutMs = 100;
export type RenderTooltipParams = {
+newNode: React.Node,
@@ -96,10 +97,20 @@
);
// eslint-disable-next-line no-unused-vars
- const onMouseEnterTooltip = React.useCallback(() => {}, []);
+ const onMouseEnterTooltip = React.useCallback(() => {
+ if (tooltipSymbol.current) {
+ clearTimeout(tooltipCancelTimer.current);
+ }
+ }, []);
// eslint-disable-next-line no-unused-vars
- const onMouseLeaveTooltip = React.useCallback(() => {}, []);
+ const onMouseLeaveTooltip = React.useCallback(() => {
+ const timer = setTimeout(
+ clearCurrentTooltip,
+ onMouseLeaveTooltipDisappearTimeoutMs,
+ );
+ tooltipCancelTimer.current = timer;
+ }, [clearCurrentTooltip]);
const tooltip = React.useMemo(() => {}, []);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 1:04 PM (18 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2569843
Default Alt Text
D4910.id16052.diff (1 KB)
Attached To
Mode
D4910: [web] Introduce `onMouse` calbacks for tooltip component in `TooltipContext`
Attached
Detach File
Event Timeline
Log In to Comment