From d278f30f043e8ec6a09aea920e260fc5c89e47c8 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:49:44 +0900 Subject: [PATCH] =?UTF-8?q?keydown=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/MkEmojiPicker.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkEmojiPicker.vue b/packages/frontend/src/components/MkEmojiPicker.vue index 14a02b2dcc3c..82037b1f664f 100644 --- a/packages/frontend/src/components/MkEmojiPicker.vue +++ b/packages/frontend/src/components/MkEmojiPicker.vue @@ -16,8 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only autocapitalize="off" @input="input()" @paste.stop="paste" - @keydown.stop.prevent.enter="onEnter" - @keydown.stop.prevent.esc="emit('esc')" + @keydown.stop="onKeydown" >
@@ -447,9 +446,18 @@ function paste(event: ClipboardEvent): void { } } -function onEnter(ev: KeyboardEvent) { +function onKeydown(ev: KeyboardEvent) { if (ev.isComposing || ev.key === 'Process' || ev.keyCode === 229) return; - done(); + if (ev.key === 'Enter') { + ev.preventDefault(); + ev.stopPropagation(); + done(); + } + if (ev.key === 'Escape') { + ev.preventDefault(); + ev.stopPropagation(); + emit('esc'); + } } function done(query?: string): boolean | void {