Desktop: Fixes #5953: Note list buttons do not reappear after changing app layout (#5994)

pull/6017/head
asrient 2022-01-15 22:35:31 +05:30 committed by GitHub
parent 6a1f3ace67
commit 7088be01c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -139,6 +139,21 @@ function SearchBar(props: Props) {
}
}, [props.notesParentType, onExitSearch]);
// When the searchbar is remounted, exit the search if it was previously open
// or else other buttons stay hidden (e.g. when opening Layout Editor and closing it)
// https://github.com/laurent22/joplin/issues/5953
useEffect(() => {
if (props.notesParentType === 'Search' || props.isFocused) {
if (props.isFocused) {
props.dispatch({
type: 'FOCUS_CLEAR',
field: 'globalSearch',
});
}
void onExitSearch(true);
}
}, []);
return (
<Root className="search-bar">
<SearchInput