perf(search): autofocus and / shortcut to open search (#949)

* search autofocus and / shortcut to open search

* search autofocus and / shortcut to open search
This commit is contained in:
Andreas 2023-07-15 22:36:33 +02:00 committed by GitHub
parent 3f39a2b06b
commit b2edc3274d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -12,6 +12,7 @@
:rules="[v => !!v || 'Search term is required']"
label="Search pattern"
@keydown.enter.prevent="runNewSearch"
autofocus
/>
</v-col>
<v-col cols="6" sm="5" md="2">

View file

@ -473,6 +473,10 @@ export default {
return this.createModal('ConfirmDeleteModal')
}
// 'Search' => Search view
if (e.key === "/" && this.$route.name !== 'search' && document.activeElement !== document.getElementById('searchInput'))
this.$router.push({ name: 'search' })
}
}
}