SubMenu item seçilince kaybolması

This commit is contained in:
Sedat Öztürk 2026-02-08 20:54:51 +03:00
parent 1c93a7acb9
commit cafd4d9184
2 changed files with 8 additions and 1 deletions

View file

@ -106,9 +106,11 @@ const DropdownItem = forwardRef<HTMLElement, DropdownItemProps>(
openSubmenuIfExists()
} else {
activate(e)
// Close the current menu after activation
menuControl?.closeMenu()
}
},
[disabled, submenu, openSubmenuIfExists, activate]
[disabled, submenu, openSubmenuIfExists, activate, menuControl]
)
const handleMouseOver = useCallback(() => {

View file

@ -38,6 +38,11 @@ const DropdownMenu = forwardRef<HTMLElement, DropdownMenuProps>(
className={dropdownSubmenuClass}
placement={placement}
{...rest}
onSelect={(eventKey, e) => {
// Call both parent and current onSelect
rest.onSelect?.(eventKey, e)
parentMenu?.onSelect?.(eventKey, e)
}}
/>
)