Skip to content

Commit

Permalink
[Menu] Reset hoverEnabled state on close (mui#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Feb 28, 2025
1 parent 5993a7e commit 38cef89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/react/src/menu/root/useMenuRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,13 @@ export function useMenuRoot(parameters: useMenuRoot.Parameters): useMenuRoot.Ret
},
);

if (!open && !hoverEnabled) {
setHoverEnabled(true);
}

const handleUnmount = useEventCallback(() => {
setMounted(false);
setOpenReason(null);
setHoverEnabled(true);
setStickIfOpen(true);
onOpenChangeComplete?.(false);
});
Expand Down

0 comments on commit 38cef89

Please sign in to comment.