Fix search input shortcut (#2140)
* Add handler for slash shortcut * Fix lint errors * Change Slash shortcut to Alt+KeyD
This commit is contained in:
parent
6559732207
commit
86bdb5e2ae
|
@ -303,6 +303,9 @@ export default Vue.extend({
|
|||
case 'ArrowLeft':
|
||||
this.$refs.topNav.historyBack()
|
||||
break
|
||||
case 'KeyD':
|
||||
this.$refs.topNav.focusSearch()
|
||||
break
|
||||
}
|
||||
}
|
||||
switch (event.code) {
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
/>
|
||||
<input
|
||||
:id="id"
|
||||
ref="input"
|
||||
v-model="inputData"
|
||||
:list="idDataList"
|
||||
class="ft-input"
|
||||
|
|
|
@ -36,6 +36,10 @@ export default Vue.extend({
|
|||
return this.$store.getters.getEnableSearchSuggestions
|
||||
},
|
||||
|
||||
searchInput: function () {
|
||||
return this.$refs.searchInput.$refs.input
|
||||
},
|
||||
|
||||
searchSettings: function () {
|
||||
return this.$store.getters.getSearchSettings
|
||||
},
|
||||
|
@ -197,6 +201,10 @@ export default Vue.extend({
|
|||
this.showFilters = false
|
||||
},
|
||||
|
||||
focusSearch: function () {
|
||||
this.searchInput.focus()
|
||||
},
|
||||
|
||||
getSearchSuggestionsDebounce: function (query) {
|
||||
if (this.enableSearchSuggestions) {
|
||||
this.debounceSearchResults(query)
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
<div class="middle">
|
||||
<div class="searchContainer">
|
||||
<ft-input
|
||||
ref="searchInput"
|
||||
:placeholder="$t('Search / Go to URL')"
|
||||
class="searchInput"
|
||||
:is-search="true"
|
||||
|
|
Loading…
Reference in New Issue