FIX: better cursor stability

FIX: better cursor stability

Previously we depended on runloop which is not stable and leads to cursor drift

This updates textarea directly, and relies on ember bypassing the update cause it notices text did not change

diff --git a/assets/javascripts/lib/shared-edits.js.es6 b/assets/javascripts/lib/shared-edits.js.es6
index 2f91166..b7bf46c 100644
--- a/assets/javascripts/lib/shared-edits.js.es6
+++ b/assets/javascripts/lib/shared-edits.js.es6
@@ -2,7 +2,7 @@ import { ajax } from "discourse/lib/ajax";
 import EmberObject from "@ember/object";
 import { popupAjaxError } from "discourse/lib/ajax-error";
 import loadScript from "discourse/lib/load-script";
-import { throttle, next } from "@ember/runloop";
+import { throttle } from "@ember/runloop";
 
 const THROTTLE_SAVE = 500;
 
@@ -187,10 +187,9 @@ const SharedEditManager = EmberObject.extend({
           newChanges
         );
 
-        next(null, () => {
-          input.selectionStart = position;
-          input.selectionEnd = position + selLength;
-        });
+        input.value = newRaw;
+        input.selectionStart = position;
+        input.selectionEnd = position + selLength;
       }
 
       this.composer.set("reply", newRaw);

GitHub sha: 623803c2