From 54143b573079250b441834df980a6e04a22e5517 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 10 Jan 2025 17:40:54 -0400 Subject: client: always capture up/down in search input --- src/static/js/client/sidebar-search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/static/js/client/sidebar-search.js') 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}); } } -- cgit 1.3.0-6-gf8a5