FIX: when replacing text in composer maintain history (#28537)
Replacing value in the composer will not maintain history, this migrates us to the new pattern used throughout this file
This commit is contained in:
parent
6832c7b7e7
commit
e25578d702
|
@ -152,10 +152,11 @@ export default Mixin.create({
|
||||||
i++;
|
i++;
|
||||||
return i === opts.index ? newVal : match;
|
return i === opts.index ? newVal : match;
|
||||||
});
|
});
|
||||||
this.set("value", newValue);
|
|
||||||
|
this._insertAt(0, val.length, newValue);
|
||||||
} else {
|
} else {
|
||||||
// Replace value (side effect: cursor at the end).
|
const replacedValue = val.replace(oldVal, newVal);
|
||||||
this.set("value", val.replace(oldVal, newVal));
|
this._insertAt(0, val.length, replacedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue