diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index dcf06b0ced1..15d74432812 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -520,6 +520,11 @@ export default { } else { this.text = this.chatInput } + + this.$nextTick(() => { + // set cursor at the end + selectRange(getRangeAtEnd(this.getContenteditable()), this.getContenteditable()) + }) }, parentMessage(newValue) { @@ -847,8 +852,7 @@ export default { }, restoreSelectionRange() { - // If nothing to restore, set cursor at the end - selectRange(this.preservedSelectionRange ?? getRangeAtEnd(this.getContenteditable()), this.getContenteditable()) + selectRange(this.preservedSelectionRange, this.getContenteditable()) this.preservedSelectionRange = null },