fix: send on enter

This commit is contained in:
Shariq Ansari 2024-04-19 15:03:15 +05:30
parent f22d39ce29
commit b214d76e93

View File

@ -26,7 +26,7 @@
:placeholder="placeholder"
@focus="rows = 6"
@blur="rows = 1"
@keydown.meta.enter="sendWhatsAppMessage"
@keydown.enter="(e) => sendTextMessage(e)"
/>
<div class="flex justify-end gap-2">
<Button
@ -72,6 +72,13 @@ function uploadFile(file) {
sendWhatsAppMessage()
}
function sendTextMessage(event) {
if (event.shiftKey) return
sendWhatsAppMessage()
textarea.value.$el.blur()
content.value = ''
}
async function sendWhatsAppMessage() {
let args = {
reference_doctype: props.doctype,