This commit is contained in:
jloqfjgk 2021-11-11 10:29:40 +00:00 committed by FireMaskterK
parent edb7e6bfc6
commit 635b850197
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -24,6 +24,7 @@
:title="$t('actions.search')"
:placeholder="$t('actions.search')"
@keyup="onKeyUp"
@keypress="onKeyPress"
@focus="onInputFocus"
@blur="onInputBlur"
/>
@ -57,6 +58,7 @@
:title="$t('actions.search')"
:placeholder="$t('actions.search')"
@keyup="onKeyUp"
@keypress="onKeyPress"
@focus="onInputFocus"
@blur="onInputBlur"
/>
@ -92,6 +94,12 @@ export default {
},
methods: {
onKeyUp(e) {
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
e.preventDefault();
}
this.$refs.searchSuggestions.onKeyUp(e);
},
onKeyPress(e) {
if (e.key === "Enter") {
e.target.blur();
this.$router.push({
@ -99,10 +107,7 @@ export default {
query: { search_query: this.searchText },
});
return;
} else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
e.preventDefault();
}
this.$refs.searchSuggestions.onKeyUp(e);
},
onInputFocus() {
this.suggestionsVisible = true;