diff --git a/src/components/AddressSearch/index.tsx b/src/components/AddressSearch/index.tsx index 077814cb376..9c72b371c40 100644 --- a/src/components/AddressSearch/index.tsx +++ b/src/components/AddressSearch/index.tsx @@ -326,11 +326,12 @@ function AddressSearch( const filteredPredefinedPlaces = useMemo(() => { if (!searchValue) { return predefinedPlaces ?? []; - } else if (shouldHidePredefinedPlaces) { + } + if (shouldHidePredefinedPlaces) { return []; } return predefinedPlaces?.filter((predefinedPlace) => isPlaceMatchForSearch(searchValue, predefinedPlace)) ?? []; - }, [predefinedPlaces, searchValue]); + }, [predefinedPlaces, searchValue, shouldHidePredefinedPlaces]); const listEmptyComponent = useMemo( () => (!isTyping ? undefined : {translate('common.noResultsFound')}),