From 48c3ff8112b2f92a0246783136bcf2cd5e141c2c Mon Sep 17 00:00:00 2001 From: NoriDev Date: Thu, 18 May 2023 16:47:27 +0900 Subject: [PATCH] fix: Sending by pressing enter in chat doesn't work --- .../src/pages/messaging/messaging-room.form.vue | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/frontend/src/pages/messaging/messaging-room.form.vue b/packages/frontend/src/pages/messaging/messaging-room.form.vue index 6ab9272c9f..58ff8bb267 100644 --- a/packages/frontend/src/pages/messaging/messaging-room.form.vue +++ b/packages/frontend/src/pages/messaging/messaging-room.form.vue @@ -100,9 +100,9 @@ function onDragover(ev: DragEvent) { switch (ev.dataTransfer.effectAllowed) { case 'all': case 'uninitialized': - case 'copy': - case 'copyLink': - case 'copyMove': + case 'copy': + case 'copyLink': + case 'copyMove': ev.dataTransfer.dropEffect = 'copy'; break; case 'linkMove': @@ -144,8 +144,14 @@ function onDrop(ev: DragEvent): void { function onKeydown(ev: KeyboardEvent) { typing(); - if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) { - send(); + if (defaultStore.state.useEnterToSend && !ev.shiftKey) { + if ((ev.key === 'Enter') && canSend) { + send(); + } + } else { + if ((ev.key === 'Enter') && (ev.ctrlKey || ev.metaKey) && canSend) { + send(); + } } }