diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index 2563a27d7b2..48321af195e 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -574,14 +574,19 @@ export default { this.errorTitle = '' }, - messageToEdit(newValue) { - if (newValue) { + messageToEdit(newValue, oldValue) { + if (newValue?.id === oldValue?.id) { + // Currently edited message was updated, keep cursor position + return + } else if (newValue) { + // Enter editing mode or editing another message this.text = this.chatExtrasStore.getChatEditInput(this.token) this.chatExtrasStore.removeThreadTitle(this.token) if (this.parentMessage) { this.chatExtrasStore.removeParentIdToReply(this.token) } } else { + // Leaving editing mode this.text = this.chatInput }