diff --git a/packages/components/menu/src/menu.tsx b/packages/components/menu/src/menu.tsx index 2e7bab14f2..9fdc539d56 100644 --- a/packages/components/menu/src/menu.tsx +++ b/packages/components/menu/src/menu.tsx @@ -1,5 +1,5 @@ import {forwardRef} from "@nextui-org/system"; -import {ForwardedRef, ReactElement, Ref} from "react"; +import {ForwardedRef, Key, ReactElement, Ref} from "react"; import {UseMenuProps, useMenu} from "./use-menu"; import MenuSection from "./menu-section"; @@ -18,7 +18,7 @@ function Menu(props: Props, ref: ForwardedRef(props: Props, ref: ForwardedRef({...props, ref}); + const onAction = (key: Key) => { + if (closeOnSelect) { + onTopAction?.(key); + } + }; + const content = ( {!state.collection.size && !hideEmptyContent && (