pages/search: improve usability

This commit is contained in:
He4eT 2024-01-21 04:52:33 +01:00
commit dbb7724253
3 changed files with 16 additions and 10 deletions

View file

@ -80,11 +80,9 @@ export const attachInputHandlers = (store) => {
searchBox.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
let visibleTabs = store.getCurrentState().results
if (visibleTabs.length === 1) {
if (visibleTabs.length > 0) {
const tabId = visibleTabs[0].obj.id
switchToTab(tabId)
} else {
actionbox.focus()
}
}
})