A platform for community discussion. Free, open, simple.
FIX: when replacing text in composer maintain history (#28537)
Same25578d70279
diff --git a/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js b/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.jsindex 66b38af04b2..84fcff21eb1 100644--- a/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js+++ b/app/assets/javascripts/discourse/app/mixins/textarea-text-manipulation.js@@ -152,10 +152,11 @@ export default Mixin.create({i++;return i === opts.index ? newVal : match;});- this.set("value", newValue);++ this._insertAt(0, val.length, newValue);} else {- // Replace value (side effect: cursor at the end).- this.set("value", val.replace(oldVal, newVal));+ const replacedValue = val.replace(oldVal, newVal);+ this._insertAt(0, val.length, replacedValue);}if (