diff --git a/src/common/NavBar/SearchBar/SearchBar.js b/src/common/NavBar/SearchBar/SearchBar.js index 3b989a70c..0d10a784a 100644 --- a/src/common/NavBar/SearchBar/SearchBar.js +++ b/src/common/NavBar/SearchBar/SearchBar.js @@ -18,11 +18,9 @@ const SearchBar = React.memo(({ className }) => { const query = (active && queryParams.has('q')) ? queryParams.get('q') : ''; return [active, query]; }, [locationHash]); - const onQueryInputFocus = React.useCallback(() => { - if (!active) { - window.location = '#/search'; - } - }, [active]); + const navigateToSearch = React.useCallback(() => { + window.location = '#/search'; + }, []); const onQueryInputSubmit = React.useCallback(() => { window.location.replace(`#/search?q=${searchInputRef.current.value}`); }, []); @@ -32,23 +30,29 @@ const SearchBar = React.memo(({ className }) => { } }, [active, focusable]); return ( -