diff --git a/src/renderer/src/components/ChatInput.vue b/src/renderer/src/components/ChatInput.vue index 74b32e855..ae60c6d37 100644 --- a/src/renderer/src/components/ChatInput.vue +++ b/src/renderer/src/components/ChatInput.vue @@ -1023,13 +1023,11 @@ defineExpose({ inputText.value = text nextTick(() => { editor.chain().clearContent().insertContent(text).run() - nextTick(() => { - editor.view.updateState(editor.state) - setTimeout(() => { - const docSize = editor.state.doc.content.size - editor.chain().focus().setTextSelection(docSize).run() - }, 10) - }) + editor.view.updateState(editor.state) + setTimeout(() => { + const docSize = editor.state.doc.content.size + editor.chain().focus().setTextSelection(docSize).run() + }, 10) }) } })