Fix keybinding in chatting

This commit is contained in:
LittleSheep 2024-04-05 13:29:53 +08:00
parent 4e4bc3345d
commit 0b24b7cc05

View File

@ -67,8 +67,7 @@
:max-rows="6"
:loading="loading"
v-model="data.content"
@keyup.ctrl.enter="sendMessage"
@keyup.meta.enter="sendMessage"
@keydown="onEditorKeydown"
@paste="pasteMedia"
>
<template #append>
@ -161,6 +160,12 @@ async function sendMessage() {
loading.value = false
}
function onEditorKeydown(event: KeyboardEvent) {
if ((event.ctrlKey || event.metaKey) && event.key.toLowerCase() === "enter") {
sendMessage()
}
}
watch(
() => channels.related.messages.reply_to,
(val) => {