From 124b7135cd794d0adb6be7134be922cdd93498b3 Mon Sep 17 00:00:00 2001
From: Bruno Windels <brunow@matrix.org>
Date: Thu, 5 Sep 2019 17:54:08 +0200
Subject: [PATCH] make sure the update callback gets a caret when calling reset

---
 src/editor/model.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/editor/model.js b/src/editor/model.js
index 613be5b4bd..5da3477443 100644
--- a/src/editor/model.js
+++ b/src/editor/model.js
@@ -149,6 +149,9 @@ export default class EditorModel {
 
     reset(serializedParts, caret, inputType) {
         this._parts = serializedParts.map(p => this._partCreator.deserializePart(p));
+        if (!caret) {
+            caret = this.getPositionAtEnd();
+        }
         // close auto complete if open
         // this would happen when clearing the composer after sending
         // a message with the autocomplete still open