From fb651c55c13b506f631c7cefff039cbe47bec85f Mon Sep 17 00:00:00 2001 From: Sophie Turner Date: Sun, 23 Jun 2024 00:58:50 +0500 Subject: [PATCH] fix(sidebar): search text clears upon collapsing side panel button --- src/components/App/SideBar/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/App/SideBar/index.tsx b/src/components/App/SideBar/index.tsx index 70c29fc7c..475f1633d 100644 --- a/src/components/App/SideBar/index.tsx +++ b/src/components/App/SideBar/index.tsx @@ -38,7 +38,14 @@ const Content = forwardRef(({ onSubmit, subViewOpen const filteredNodes = useFilteredNodes() - const { setSidebarOpen, currentSearch: searchTerm, clearSearch, searchFormValue } = useAppStore((s) => s) + const { + setSidebarOpen, + currentSearch: searchTerm, + clearSearch, + searchFormValue, + setSearchFormValue, + } = useAppStore((s) => s) + const [trendingTopicsFeatureFlag] = useFeatureFlagStore((s) => [s.trendingTopicsFeatureFlag]) const { setValue, watch } = useFormContext() @@ -122,6 +129,7 @@ const Content = forwardRef(({ onSubmit, subViewOpen onClick={() => { setSidebarOpen(false) setTeachMe(false) + setSearchFormValue(searchTerm || '') }} >