pages/search: add hints for actionbox

This commit is contained in:
He4eT 2024-01-26 16:28:41 +01:00
commit 85a8aaa8ff
3 changed files with 37 additions and 6 deletions

View file

@ -2,7 +2,11 @@ import { actionboxHandlers } from './actionboxHandlers.js'
const focusButtonsWithArrows = (e, abortCallback) => {
if (['ArrowUp', 'ArrowDown'].includes(e.key)) {
e.preventDefault()
if (document.activeElement.dataset.arrowNavigation === 'ignore') {
return
} else {
e.preventDefault()
}
const buttons = document.querySelectorAll('#searchResults > button')
if (buttons.length === 0) { return }