From 631ecccb1e5390b1dfdfd955988c87d7994eb07f Mon Sep 17 00:00:00 2001 From: devsynck Date: Sun, 22 Feb 2026 13:11:17 +0530 Subject: [PATCH] fix: database dropdown selection on click --- src/components/ui/SearchableSelect.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 && (