diff --git a/packages/menu-button/src/index.tsx b/packages/menu-button/src/index.tsx index e0c858b29..198ed463a 100644 --- a/packages/menu-button/src/index.tsx +++ b/packages/menu-button/src/index.tsx @@ -879,15 +879,9 @@ export const MenuPopover = forwardRef( if (buttonClickedRef.current) { buttonClickedRef.current = false; } else { - let { relatedTarget, target } = event; - // We on want to close only if focus rests outside the menu if (isExpanded && popoverRef.current) { - if ( - !popoverRef.current?.contains( - (relatedTarget || target) as Element - ) - ) { + if (!popoverRef.current.contains(event.target as Element)) { dispatch({ type: CLOSE_MENU, payload: { buttonRef } }); } }