diff --git a/packages/ui/src/dropdowns/custom-search-select.tsx b/packages/ui/src/dropdowns/custom-search-select.tsx index d1778e31a..275506ad7 100644 --- a/packages/ui/src/dropdowns/custom-search-select.tsx +++ b/packages/ui/src/dropdowns/custom-search-select.tsx @@ -66,6 +66,11 @@ export const CustomSearchSelect = (props: ICustomSearchSelectProps) => { const handleKeyDown = useDropdownKeyDown(openDropdown, closeDropdown, isOpen); useOutsideClickDetector(dropdownRef, closeDropdown); + const toggleDropdown = () => { + if (isOpen) closeDropdown(); + else openDropdown(); + }; + return ( { ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80" } ${customButtonClassName}`} - onClick={openDropdown} + onClick={toggleDropdown} > {customButton} @@ -107,7 +112,7 @@ export const CustomSearchSelect = (props: ICustomSearchSelectProps) => { ? "cursor-not-allowed text-custom-text-200" : "cursor-pointer hover:bg-custom-background-80" } ${buttonClassName}`} - onClick={openDropdown} + onClick={toggleDropdown} > {label} {!noChevron && !disabled &&