From 6580e42a72beaa65f99b5d2a09df038a35923d3e Mon Sep 17 00:00:00 2001 From: Matthew Weeks Date: Mon, 11 Sep 2023 15:12:50 -0400 Subject: [PATCH] fix: close tooltip menu on click --- src/components/TooltipMenu.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/TooltipMenu.tsx b/src/components/TooltipMenu.tsx index 63b7c3d9..d1a84d07 100644 --- a/src/components/TooltipMenu.tsx +++ b/src/components/TooltipMenu.tsx @@ -25,11 +25,19 @@ export const TooltipMenu = ({ children, links, note, ...props }: TooltipMenuProp closeOnOutsideClick closeOnTriggerHidden onVisibleChange={(visible) => setActive(visible)} - tooltip={ + tooltip={({ onHide }) => ( - + ({ + ...link, + onClick: (...args) => { + onHide(); + return link.onClick(...args); + }, + }))} + /> - } + )} trigger="click" {...props} >