diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2025-01-10 17:40:54 -0400 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2025-01-10 18:51:26 -0400 |
commit | 54143b573079250b441834df980a6e04a22e5517 (patch) | |
tree | bf8ca2a048683fc45ab612ae8e4d55435749bf4d /src/static/js | |
parent | 135811201a999ec21d60a2380ddd870311679704 (diff) |
client: always capture up/down in search input
Diffstat (limited to 'src/static/js')
-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}); } } |