« get me outta code hell

client: sidebar-search: Shift+/ to focus search - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-03-11 09:48:12 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-03-11 09:48:12 -0300
commite934623d775625d6532bfd73f19d22c185a3e8a9 (patch)
treef0a0e087318e8b02bde9ebd598bd6a3b2e2ad74c /src/static/js
parent8c2360a714e39651165d591124cf77a772f26fce (diff)
client: sidebar-search: Shift+/ to focus search preview
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/client/sidebar-search.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js
index 0b905948..a7434548 100644
--- a/src/static/js/client/sidebar-search.js
+++ b/src/static/js/client/sidebar-search.js
@@ -604,6 +604,18 @@ export function addPageListeners() {
         saveSidebarSearchResultsScrollOffset();
       }, settings.stoppedScrollingDelay);
   });
+
+  document.addEventListener('keypress', domEvent => {
+    const {tagName} = document.activeElement ?? {};
+    if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
+      return;
+    }
+
+    if (event.shiftKey && event.code === 'Slash') {
+      domEvent.preventDefault();
+      info.searchLabel.click();
+    }
+  });
 }
 
 export function initializeState() {