Skip to content

Commit

Permalink
fix tooltip drop
Browse files Browse the repository at this point in the history
  • Loading branch information
anish-work committed Sep 6, 2024
1 parent e80c617 commit 28504cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/shared/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const GooeyTooltip = ({
const [showModal, setShowModal] = useState(false);
const timerRef = useRef<any>(null);
const arrowStyles = getArrowStyles(direction);
if (disabled) return children;
return (
<GooeyPopper
ModalContent={() => (
Expand Down Expand Up @@ -102,10 +101,12 @@ const GooeyTooltip = ({
// prevent click/touch event from triggering the tooltip
e.preventDefault();
e.stopPropagation();
e.persist();
if (timerRef.current) clearTimeout(timerRef.current);
setShowModal(false);
}}
onMouseEnter={() => {
if (disabled) return;
timerRef.current = setTimeout(() => {
setShowModal(true);
timerRef.current = null;
Expand Down

0 comments on commit 28504cf

Please sign in to comment.