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':
|
case 'ArrowLeft':
|
||||||
this.$refs.topNav.historyBack()
|
this.$refs.topNav.historyBack()
|
||||||
break
|
break
|
||||||
|
case 'KeyD':
|
||||||
|
this.$refs.topNav.focusSearch()
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (event.code) {
|
switch (event.code) {
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
/>
|
/>
|
||||||
<input
|
<input
|
||||||
:id="id"
|
:id="id"
|
||||||
|
ref="input"
|
||||||
v-model="inputData"
|
v-model="inputData"
|
||||||
:list="idDataList"
|
:list="idDataList"
|
||||||
class="ft-input"
|
class="ft-input"
|
||||||
|
|
|
@ -36,6 +36,10 @@ export default Vue.extend({
|
||||||
return this.$store.getters.getEnableSearchSuggestions
|
return this.$store.getters.getEnableSearchSuggestions
|
||||||
},
|
},
|
||||||
|
|
||||||
|
searchInput: function () {
|
||||||
|
return this.$refs.searchInput.$refs.input
|
||||||
|
},
|
||||||
|
|
||||||
searchSettings: function () {
|
searchSettings: function () {
|
||||||
return this.$store.getters.getSearchSettings
|
return this.$store.getters.getSearchSettings
|
||||||
},
|
},
|
||||||
|
@ -197,6 +201,10 @@ export default Vue.extend({
|
||||||
this.showFilters = false
|
this.showFilters = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
focusSearch: function () {
|
||||||
|
this.searchInput.focus()
|
||||||
|
},
|
||||||
|
|
||||||
getSearchSuggestionsDebounce: function (query) {
|
getSearchSuggestionsDebounce: function (query) {
|
||||||
if (this.enableSearchSuggestions) {
|
if (this.enableSearchSuggestions) {
|
||||||
this.debounceSearchResults(query)
|
this.debounceSearchResults(query)
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<div class="searchContainer">
|
<div class="searchContainer">
|
||||||
<ft-input
|
<ft-input
|
||||||
|
ref="searchInput"
|
||||||
:placeholder="$t('Search / Go to URL')"
|
:placeholder="$t('Search / Go to URL')"
|
||||||
class="searchInput"
|
class="searchInput"
|
||||||
:is-search="true"
|
:is-search="true"
|
||||||
|
|
Loading…
Reference in New Issue