fix: Clicking on recent not updating search input

This commit is contained in:
CuriousCorrelation committed 2022-07-15 14:18:59 +05:30
1 parent c25a824b92
commit 54f1d224bf
1 file changed
+8
+8
View File
@@ -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 (
<Scene textTitle={title}>
<RegisterKeyDown trigger="Escape" handler={goBack} />