From 09c07e58e6ccadf71bae96aee66a574886501d7a Mon Sep 17 00:00:00 2001 From: daviddeepan Date: Mon, 15 Apr 2024 19:54:33 +0530 Subject: [PATCH] search-input runtime-error fix --- .../src/components/Search/SearchBar/searchInput/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 ca52b9cadb..4e9552a1df 100644 --- a/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx +++ b/web/apps/photos/src/components/Search/SearchBar/searchInput/index.tsx @@ -56,8 +56,11 @@ export default function SearchInput(props: Iprops) { const [value, setValue] = useState(null); const appContext = useContext(AppContext); const handleChange = (value: SearchOption) => { - setValue(value); - setQuery(value.label); + if (value) { + setValue(value); + setQuery(value.label); + } + blur(); }; const handleInputChange = (value: string, actionMeta: InputActionMeta) => {