1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-17 17:42:41 +03:00

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.
This commit is contained in:
Bruno Windels
2019-08-27 09:49:22 +02:00
parent 0273795f5d
commit 5c28b57681

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);