From 1dbdedbda6abf8d20781b35747691f3b2109340d Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 25 Jun 2022 17:19:59 -0500 Subject: set focus on search input after search and on render --- src/web/src/components/Search/Searches.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/web') diff --git a/src/web/src/components/Search/Searches.js b/src/web/src/components/Search/Searches.js index 60a1d358..46a9f709 100644 --- a/src/web/src/components/Search/Searches.js +++ b/src/web/src/components/Search/Searches.js @@ -106,6 +106,7 @@ const Searches = ({ server }) => { try { ref.value = ''; + ref.focus(); } catch { // we are probably repeating an existing search; the input isn't mounted. no-op. } @@ -185,6 +186,8 @@ const Searches = ({ server }) => { history.replace(match.url.replace(`/${searchId}`, '')); } + inputRef?.current?.inputRef?.current.focus(); + return ( <> -- cgit v1.2.3