From 55dad23c4b65f9040b6b3e97c05813263b009ef7 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 11 Sep 2024 18:19:50 -0400 Subject: address review --- src/static/js/client/sidebar-search.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/static/js') 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(); } -- cgit 1.3.0-6-gf8a5