aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-06-25 17:51:34 -0500
committerGitHub <noreply@github.com>2022-06-25 17:51:34 -0500
commit18e5c8dd9a98862422a46221f99a1091a9314381 (patch)
treefe19f44b62e4e2b598857a1720409e1b8cc2fad8 /src
parentfe8ef7993d4f36845c38086b1dcf5a5d00bdf1ca (diff)
parent1dbdedbda6abf8d20781b35747691f3b2109340d (diff)
downloadslskd-18e5c8dd9a98862422a46221f99a1091a9314381.tar.gz
Merge pull request #530 from slskd/search-focus
Set focus on search input after search and on render
Diffstat (limited to 'src')
-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>