chore: custom menu dropdown improvement (#3599)
* conflict: merge conflict resolved * chore: breadcrumbs component improvement
This commit is contained in:
parent
55afef204d
commit
e69fcd410c
2 changed files with 8 additions and 1 deletions
|
|
@ -48,7 +48,13 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
|
|||
if (referenceElement) referenceElement.focus();
|
||||
};
|
||||
const closeDropdown = () => setIsOpen(false);
|
||||
|
||||
const handleKeyDown = useDropdownKeyDown(openDropdown, closeDropdown, isOpen);
|
||||
|
||||
const handleOnClick = () => {
|
||||
if (closeOnSelect) closeDropdown();
|
||||
};
|
||||
|
||||
useOutsideClickDetector(dropdownRef, closeDropdown);
|
||||
|
||||
let menuItems = (
|
||||
|
|
@ -90,6 +96,7 @@ const CustomMenu = (props: ICustomMenuDropdownProps) => {
|
|||
tabIndex={tabIndex}
|
||||
className={cn("relative w-min text-left", className)}
|
||||
onKeyDown={handleKeyDown}
|
||||
onClick={handleOnClick}
|
||||
>
|
||||
{({ open }) => (
|
||||
<>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue