« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/static/js/client/sidebar-search.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/client/sidebar-search.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();
       }