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