Skip to content

Commit

Permalink
Chore: Close tooltip on click (#26070)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Jun 29, 2022
1 parent e0245a5 commit decb096
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/meteor/client/providers/TooltipProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ const TooltipProvider: FC = ({ children }) => {
setTooltip(null);
};

const handleClick = (): void => setTooltip(null);

document.body.addEventListener('mouseover', handleMouseOver);
document.body.addEventListener('click', handleClick);

return (): void => {
if (timeout) {
clearTimeout(timeout);
}
document.body.removeEventListener('mouseover', handleMouseOver);
document.body.removeEventListener('click', handleClick);
};
}, [hasHover]);

Expand Down

0 comments on commit decb096

Please sign in to comment.