diff --git a/src/components/ui/SearchableSelect.tsx b/src/components/ui/SearchableSelect.tsx index 698b23b..7123c3c 100644 --- a/src/components/ui/SearchableSelect.tsx +++ b/src/components/ui/SearchableSelect.tsx @@ -32,6 +32,7 @@ export const SearchableSelect = ({ const containerRef = useRef(null); const buttonRef = useRef(null); const searchInputRef = useRef(null); + const dropdownRef = useRef(null); const updatePosition = useCallback(() => { if (buttonRef.current) { @@ -49,7 +50,9 @@ export const SearchableSelect = ({ const handleClickOutside = (event: MouseEvent) => { if ( containerRef.current && - !containerRef.current.contains(event.target as Node) + !containerRef.current.contains(event.target as Node) && + dropdownRef.current && + !dropdownRef.current.contains(event.target as Node) ) { setIsOpen(false); } @@ -103,6 +106,7 @@ export const SearchableSelect = ({ const dropdown = isOpen && !disabled && (