From d7b0beb949a8e2e659f7669f5598a5189e92113d Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 16 Apr 2024 09:03:35 +0530 Subject: [PATCH] [web] Clear search bar state when value is falsey Updates https://github.com/ente-io/ente/pull/1453 so that we also clear the existing state by calling the setFoo methods even when value is falsey. --- .../src/components/Search/SearchBar/searchInput/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx b/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx index 4e9552a1d..d7cf151e6 100644 --- a/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx +++ b/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx @@ -56,10 +56,8 @@ export default function SearchInput(props: Iprops) { const [value, setValue] = useState(null); const appContext = useContext(AppContext); const handleChange = (value: SearchOption) => { - if (value) { - setValue(value); - setQuery(value.label); - } + setValue(value); + setQuery(value?.label); blur(); };