✨ Fix keybinding in chatting
This commit is contained in:
parent
4e4bc3345d
commit
0b24b7cc05
@ -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) => {
|
||||||
|
Reference in New Issue
Block a user