FIX: Trigger change event when inserting text

approved
#1

FIX: Trigger change event when inserting text

This would normally not fire and result in odd behavior in the review queue when inserting links.

diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6
index 95ebc72..9521d3f 100644
--- a/app/assets/javascripts/discourse/components/d-editor.js.es6
+++ b/app/assets/javascripts/discourse/components/d-editor.js.es6
@@ -764,7 +764,7 @@ export default Ember.Component.extend({
     $textarea.val(value);
     $textarea.prop("selectionStart", insert.length);
     $textarea.prop("selectionEnd", insert.length);
-
+    Ember.run.next(() => $textarea.trigger("change"));
     this._focusTextArea();
   },

GitHub sha: f6e0c797

1 Like
Approved #2