diff options
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/js/client/sidebar-search.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js index 2d346b41..5c1b54b8 100644 --- a/src/static/js/client/sidebar-search.js +++ b/src/static/js/client/sidebar-search.js @@ -347,10 +347,13 @@ export function addPageListeners() { info.searchInput.addEventListener('drop', handleDroppedIntoSearchInput); info.searchInput.addEventListener('keydown', domEvent => { + if (domEvent.key === 'ArrowUp' || domEvent.key === 'ArrowDown') { + domEvent.preventDefault(); + } + if (domEvent.key === 'ArrowDown') { const elem = info.results.firstChild; if (elem?.classList.contains('wiki-search-result')) { - domEvent.preventDefault(); elem.focus({focusVisible: true}); } } |