From 54f1d224bfbb4f236c55f9767e1fe0cddedb476e Mon Sep 17 00:00:00 2001 From: CuriousCorrelation Date: Fri, 15 Jul 2022 14:18:59 +0530 Subject: [PATCH] fix: Clicking on recent not updating search input --- app/scenes/Search/index.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/scenes/Search/index.tsx b/app/scenes/Search/index.tsx index 81082754a6..eaf8d85625 100644 --- a/app/scenes/Search/index.tsx +++ b/app/scenes/Search/index.tsx @@ -262,6 +262,14 @@ function Search(props: Props) { const results = documents.searchResults(query); const showEmpty = !isLoading && query && results?.length === 0; + // Set `InputSearch` box value when + // `term` changes. + React.useEffect(() => { + if (searchInputRef.current) { + searchInputRef.current.value = term; + } + }, [term]); + return (