From 69c307290595384220a0cdb7caadd078d367eb69 Mon Sep 17 00:00:00 2001 From: Andrey Dolgolev Date: Mon, 2 Aug 2021 18:17:52 +0300 Subject: [PATCH] Fix card select. --- frontend/src/components/EntriesNavigation.js | 50 ++++++++------------ 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/frontend/src/components/EntriesNavigation.js b/frontend/src/components/EntriesNavigation.js index bbb3a73a..1b980d53 100644 --- a/frontend/src/components/EntriesNavigation.js +++ b/frontend/src/components/EntriesNavigation.js @@ -179,8 +179,18 @@ const EntriesNavigation = () => { const handleFilterStateCallback = (props) => { console.log("handleFilterStateCallback", props); - const newFilterState = [...filterState]; - newFilterState.push({ ...props }); + const oldFilterState = [...filterState]; + oldFilterState.push({ ...props }); + + const newFilterState = oldFilterState; + ui.setSearchTerm( + newFilterState + .map((filter) => { + return filter.direction + ":" + filter.value; + }) + .join("+") + ); + setFilterState(newFilterState); }; if (subscriptionsCache.isLoading) return ""; @@ -268,33 +278,15 @@ const EntriesNavigation = () => { )} {filter.direction === DIRECTIONS.DESTINATION && ( - + + setFilterProps(idx, { + value: e.target.value, + }) + } + placeholder="Type in address" + /> )} )}