aboutsummaryrefslogtreecommitdiffstats
path: root/src/web
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-06-25 17:19:59 -0500
committerJP Dillingham <jpdillingham@gmail.com>2022-06-25 17:19:59 -0500
commit1dbdedbda6abf8d20781b35747691f3b2109340d (patch)
treefe19f44b62e4e2b598857a1720409e1b8cc2fad8 /src/web
parentfe8ef7993d4f36845c38086b1dcf5a5d00bdf1ca (diff)
downloadslskd-1dbdedbda6abf8d20781b35747691f3b2109340d.tar.gz
set focus on search input after search and on render
Diffstat (limited to 'src/web')
-rw-r--r--src/web/src/components/Search/Searches.js3
1 files changed, 3 insertions, 0 deletions
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 (
<>
<Segment className='search-segment' raised>