Skip to content

Commit 6c77ff7

Browse files
Antreesybackportbot[bot]
authored andcommitted
fix(NewMessage): do not reset cursor on currently edited message
Signed-off-by: Maksim Sukharev <[email protected]>
1 parent 3a43984 commit 6c77ff7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/NewMessage/NewMessage.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,14 +574,19 @@ export default {
574574
this.errorTitle = ''
575575
},
576576
577-
messageToEdit(newValue) {
578-
if (newValue) {
577+
messageToEdit(newValue, oldValue) {
578+
if (newValue?.id === oldValue?.id) {
579+
// Currently edited message was updated, keep cursor position
580+
return
581+
} else if (newValue) {
582+
// Enter editing mode or editing another message
579583
this.text = this.chatExtrasStore.getChatEditInput(this.token)
580584
this.chatExtrasStore.removeThreadTitle(this.token)
581585
if (this.parentMessage) {
582586
this.chatExtrasStore.removeParentIdToReply(this.token)
583587
}
584588
} else {
589+
// Leaving editing mode
585590
this.text = this.chatInput
586591
}
587592

0 commit comments

Comments
 (0)