perf: Add 'Ctrl + F' shortcut to focus search filter (#692) @Larsluph

This commit is contained in:
Rémi Marseault 2023-03-04 17:33:36 +01:00 committed by GitHub
parent 2e21c11f0c
commit cff2191c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@
<v-expand-x-transition>
<v-card v-show="searchFilterEnabled" id="searchFilter" flat xs7 md3 class="ma-0 pa-0 transparent">
<v-text-field
id="searchInput"
v-model="input"
autofocus
flat
@ -401,6 +402,14 @@ export default {
this.selectAllTorrents()
}
// 'ctrl + F' => Focus search filter field
if (e.keyCode === 70 && e.ctrlKey) {
e.preventDefault()
this.searchFilterEnabled = true
document.getElementById('searchInput').focus()
}
// 'Delete' => Delete modal
if (e.keyCode === 46) {
e.preventDefault()