diff --git a/packages/ui/src/dropdowns/custom-menu.tsx b/packages/ui/src/dropdowns/custom-menu.tsx index 549c83fe7..316cc6960 100644 --- a/packages/ui/src/dropdowns/custom-menu.tsx +++ b/packages/ui/src/dropdowns/custom-menu.tsx @@ -68,6 +68,13 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => { if (closeOnSelect) closeDropdown(); }; + const handleMenuButtonClick = (e:React.MouseEvent)=>{ + e.stopPropagation(); + e.preventDefault() + isOpen ? closeDropdown() : openDropdown(); + if (menuButtonOnClick) menuButtonOnClick(); + } + useOutsideClickDetector(dropdownRef, closeDropdown); let menuItems = ( @@ -112,11 +119,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {