Is there a way to find the next/previous (in document order) element with tabindex="0"
?
The closest I’ve gotten is:
case 'Tab':
let item = node.closest('.listbox').nextElementSibling
do {
const focusable = item.querySelector('[tabindex="0"]')
if (focusable) {
focusable.focus()
break;
}
item = item.nextElementSibling
if (item == null) break;
} while (!item.querySelector('[tabindex="0"]'))
break;
but this stops at the parent level.