From 228587ea12b2bccd3edf30bfb6b2fcd783b6154a Mon Sep 17 00:00:00 2001 From: Manuel Wedler Date: Mon, 28 Oct 2024 16:58:15 +0100 Subject: [PATCH] Verification plugin: Fix crashing chain selector --- .../src/app/components/SearchableChainDropdown.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx b/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx index c6f78c5f2f7..bbe7ad6049b 100644 --- a/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx +++ b/apps/contract-verification/src/app/components/SearchableChainDropdown.tsx @@ -46,13 +46,14 @@ export const SearchableChainDropdown: React.FC = ({ label, id, se }) useEffect(() => { + if (!isOpen) return if (searchTerm === '') { setFilteredOptions(dropdownChains) } else { const result = fuse.search(searchTerm) setFilteredOptions(result.map(({ item }) => item)) } - }, [searchTerm, dropdownChains]) + }, [searchTerm, dropdownChains, isOpen]) // Close dropdown when user clicks outside useEffect(() => {