From d400ccbc5598f304d0daf485c295c003f6f114a9 Mon Sep 17 00:00:00 2001 From: I Nyoman Jyotisa Date: Mon, 23 Sep 2024 11:35:43 +0800 Subject: [PATCH] minor fix --- src/components/AddressSearch/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/AddressSearch/index.tsx b/src/components/AddressSearch/index.tsx index 077814cb376b..9c72b371c40f 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')}),