From c638d57afd5d99acd02b97cfd7b8dfa56fadc7a8 Mon Sep 17 00:00:00 2001 From: atomiks Date: Mon, 23 Dec 2024 18:19:42 +1100 Subject: [PATCH] Handle nesting --- packages/react/src/menu/root/useMenuRoot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/menu/root/useMenuRoot.ts b/packages/react/src/menu/root/useMenuRoot.ts index a4dad65ec9..3f8977a6fa 100644 --- a/packages/react/src/menu/root/useMenuRoot.ts +++ b/packages/react/src/menu/root/useMenuRoot.ts @@ -231,7 +231,7 @@ export function useMenuRoot(parameters: useMenuRoot.Parameters): useMenuRoot.Ret getFloatingProps( mergeReactProps(externalProps, { onMouseEnter() { - if (!openOnHover) { + if (!openOnHover || nested) { setHoverEnabled(false); } }, @@ -242,7 +242,7 @@ export function useMenuRoot(parameters: useMenuRoot.Parameters): useMenuRoot.Ret }, }), ), - [getFloatingProps, openOnHover], + [getFloatingProps, openOnHover, nested], ); return React.useMemo(