always recalculate position after doing transform step

as the amount of characters might not have changed,
parts may still have been merged, removed or added which
requires a new position.
pull/21833/head
Bruno Windels 2019-08-27 09:49:22 +02:00
parent 0273795f5d
commit 5c28b57681
1 changed files with 1 additions and 3 deletions

View File

@ -183,9 +183,7 @@ export default class EditorModel {
this._setActivePart(newPosition, canOpenAutoComplete);
if (this._transformCallback) {
const transformAddedLen = this._transform(newPosition, inputType, diff);
if (transformAddedLen !== 0) {
newPosition = this.positionForOffset(caretOffset + transformAddedLen, true);
}
newPosition = this.positionForOffset(caretOffset + transformAddedLen, true);
}
this._updateInProgress = false;
this._updateCallback(newPosition, inputType, diff);