Skip to content

Commit

Permalink
fix: assertion failure for swipe typing and undo on Android (#1898)
Browse files Browse the repository at this point in the history
  • Loading branch information
crasowas authored May 28, 2024
1 parent 7ec7d4f commit 189713b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ mixin RawEditorStateTextInputClientMixin on EditorState
// with the last known remote value.
// It is important to prevent excessive remote updates as it can cause
// race conditions.
final composingRange = _lastKnownRemoteTextEditingValue!.composing;
final actualValue = value.copyWith(
composing: _lastKnownRemoteTextEditingValue!.composing,
// Ignore last known composing range if it exceeds current text length.
composing: composingRange.end > value.text.length ? null : composingRange,
);

if (actualValue == _lastKnownRemoteTextEditingValue) {
Expand Down

0 comments on commit 189713b

Please sign in to comment.