From 6ce374405c8d5ee8d1c758d75e805b417c619dc1 Mon Sep 17 00:00:00 2001 From: Venessa Kuchenik Date: Wed, 30 Jul 2025 08:57:32 -0700 Subject: [PATCH] added behavior to tooltip tooltip disappears on click now --- .../components/layout/Canvas/components/Tooltip.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/src/components/layout/Canvas/components/Tooltip.jsx b/client/src/components/layout/Canvas/components/Tooltip.jsx index e073082..c22f943 100644 --- a/client/src/components/layout/Canvas/components/Tooltip.jsx +++ b/client/src/components/layout/Canvas/components/Tooltip.jsx @@ -12,14 +12,21 @@ export default function Tooltip ({tooltipkey, content, sidebarIsOpen, children}) { timeoutId.current = setTimeout(() => setIsVisible(true), 1000); }} + onMouseEnter={() => { timeoutId.current = setTimeout(() => setIsVisible(true), 1100); }} onMouseLeave={() => { if (timeoutId.current) { clearTimeout(timeoutId.current); timeoutId.current = null; } setIsVisible(false); - }} + }} + onClick={() => { + if (timeoutId.current) { + clearTimeout(timeoutId.current); + timeoutId.current = null; + } + setIsVisible(false); + }} > {children} {isVisible && !sidebarIsOpen && (