From 7dbd4cd8628deea0d2d81912141d564dd0cf0d9f Mon Sep 17 00:00:00 2001 From: jloqfjgk <68487118+jloqfjgk@users.noreply.github.com> Date: Thu, 11 Nov 2021 07:37:19 +0000 Subject: [PATCH] Test keypress for IME input issue --- src/components/Navigation.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue index c996f919..ace423f2 100644 --- a/src/components/Navigation.vue +++ b/src/components/Navigation.vue @@ -57,6 +57,7 @@ :title="$t('actions.search')" :placeholder="$t('actions.search')" @keyup="onKeyUp" + @keypress="onKeyPress" @focus="onInputFocus" @blur="onInputBlur" /> @@ -92,6 +93,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 +106,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;