From e023a13bbcd8a48a5f1a18293377a65c10e7399d Mon Sep 17 00:00:00 2001 From: Rafi Date: Tue, 18 Apr 2023 10:37:16 +0800 Subject: [PATCH] feat(editor): Make the editor automatically focus after selecting a prompt. --- components/MsgEditor.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/MsgEditor.vue b/components/MsgEditor.vue index b9d2ba1..d452b58 100644 --- a/components/MsgEditor.vue +++ b/components/MsgEditor.vue @@ -48,8 +48,11 @@ const send = () => { message.value = "" } +const textArea = ref() + const usePrompt = (prompt) => { message.value = prompt + textArea.value.focus() } const clickSendBtn = () => { @@ -73,6 +76,7 @@ defineExpose({ class="flex-grow-1 d-flex align-center justify-space-between" >