« get me outta code hell

address review - 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:
authorleo60228 <leo@60228.dev>2024-09-11 18:19:50 -0400
committer(quasar) nebula <qznebula@protonmail.com>2025-01-10 18:51:25 -0400
commit55dad23c4b65f9040b6b3e97c05813263b009ef7 (patch)
tree6566d44b3f3503a0b00a0ce5f313ccdf55b78112 /src/static/js
parent21de3c57d4a5364228fc95ffc3d79dae5ea16586 (diff)
address review
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/client/sidebar-search.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js
index 917b9c12..34d2161f 100644
--- a/src/static/js/client/sidebar-search.js
+++ b/src/static/js/client/sidebar-search.js
@@ -330,11 +330,11 @@ export function addPageListeners() {
   info.searchInput.addEventListener('drop', handleDroppedIntoSearchInput);
 
   info.searchInput.addEventListener('keydown', domEvent => {
-    if (domEvent.key === 'ArrowDown' && info.searchInput.value.length === info.searchInput.selectionStart) {
+    if (domEvent.key === 'ArrowDown') {
       const elem = info.results?.firstChild;
       if (elem && !elem.classList.contains('wiki-search-no-results')) {
         domEvent.preventDefault();
-        elem.focus();
+        elem.focus({focusVisible: true});
       }
     }
   });
@@ -790,13 +790,13 @@ function generateSidebarSearchResultTemplate(slots, info) {
       const elem = link.nextElementSibling;
       if (elem) {
         domEvent.preventDefault();
-        elem.focus();
+        elem.focus({focusVisible: true});
       }
     } else if (domEvent.key === 'ArrowUp') {
       domEvent.preventDefault();
       const elem = link.previousElementSibling;
       if (elem) {
-        elem.focus();
+        elem.focus({focusVisible: true});
       } else {
         info.searchInput.focus();
       }