mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-23 14:03:35 +00:00
Fix for searching when composing in search box (#519)
Co-authored-by: jloqfjgk <68487118+jloqfjgk@users.noreply.github.com>
This commit is contained in:
parent
edb7e6bfc6
commit
cc79eb5c6c
@ -24,6 +24,7 @@
|
|||||||
:title="$t('actions.search')"
|
:title="$t('actions.search')"
|
||||||
:placeholder="$t('actions.search')"
|
:placeholder="$t('actions.search')"
|
||||||
@keyup="onKeyUp"
|
@keyup="onKeyUp"
|
||||||
|
@keypress="onKeyPress"
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
@blur="onInputBlur"
|
@blur="onInputBlur"
|
||||||
/>
|
/>
|
||||||
@ -57,6 +58,7 @@
|
|||||||
:title="$t('actions.search')"
|
:title="$t('actions.search')"
|
||||||
:placeholder="$t('actions.search')"
|
:placeholder="$t('actions.search')"
|
||||||
@keyup="onKeyUp"
|
@keyup="onKeyUp"
|
||||||
|
@keypress="onKeyPress"
|
||||||
@focus="onInputFocus"
|
@focus="onInputFocus"
|
||||||
@blur="onInputBlur"
|
@blur="onInputBlur"
|
||||||
/>
|
/>
|
||||||
@ -92,6 +94,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onKeyUp(e) {
|
onKeyUp(e) {
|
||||||
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
this.$refs.searchSuggestions.onKeyUp(e);
|
||||||
|
},
|
||||||
|
onKeyPress(e) {
|
||||||
if (e.key === "Enter") {
|
if (e.key === "Enter") {
|
||||||
e.target.blur();
|
e.target.blur();
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
@ -99,10 +107,7 @@ export default {
|
|||||||
query: { search_query: this.searchText },
|
query: { search_query: this.searchText },
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
} else if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
}
|
||||||
this.$refs.searchSuggestions.onKeyUp(e);
|
|
||||||
},
|
},
|
||||||
onInputFocus() {
|
onInputFocus() {
|
||||||
this.suggestionsVisible = true;
|
this.suggestionsVisible = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user