Fix exception

pull/239/head
Till Friebe 4 years ago
parent 3d6a915d26
commit e6f1160d71
  1. 6
      lib/src/widgets/raw_editor/raw_editor_state_text_input_client_mixin.dart

@ -103,7 +103,11 @@ mixin RawEditorStateTextInputClientMixin on EditorState
final shouldRemember = final shouldRemember =
getTextEditingValue().text != _lastKnownRemoteTextEditingValue!.text; getTextEditingValue().text != _lastKnownRemoteTextEditingValue!.text;
_lastKnownRemoteTextEditingValue = actualValue; _lastKnownRemoteTextEditingValue = actualValue;
_textInputConnection!.setEditingState(actualValue); _textInputConnection!.setEditingState(
// Set composing to (-1, -1), otherwise an exception will be thrown if
// the values are different.
actualValue.copyWith(composing: const TextRange(start: -1, end: -1)),
);
if (shouldRemember) { if (shouldRemember) {
// Only keep track if text changed (selection changes are not relevant) // Only keep track if text changed (selection changes are not relevant)
_sentRemoteValues.add(actualValue); _sentRemoteValues.add(actualValue);

Loading…
Cancel
Save