Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address nit
  • Loading branch information
knopp committed Aug 15, 2023
commit 5e64ea60d43d4afd532b1d36c540c315be838f32
5 changes: 2 additions & 3 deletions lib/web_ui/lib/src/engine/text_editing/text_editing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,6 @@ abstract class DefaultTextEditingStrategy with CompositionAwareMixin implements
@override
void setEditingState(EditingState? editingState) {
lastEditingState = editingState;
_editingDeltaState = null;
if (!isEnabled || !editingState!.isValid) {
return;
}
Expand Down Expand Up @@ -1394,9 +1393,9 @@ abstract class DefaultTextEditingStrategy with CompositionAwareMixin implements
lastEditingState = newEditingState;
_editingDeltaState = newTextEditingDeltaState;
onChange!(lastEditingState, _editingDeltaState);
// Flush delta after it has been sent to framework.
_editingDeltaState = null;
}
// Flush delta after it has been sent to framework.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe change this to flush delta state.

_editingDeltaState = null;
}

void handleBeforeInput(DomEvent event) {
Expand Down
1 change: 1 addition & 0 deletions lib/web_ui/test/engine/text_editing_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2810,6 +2810,7 @@ Future<void> testMain() async {
expect(editingStrategy!.editingDeltaState.oldText, 'foo bar');

editingStrategy!.setEditingState(EditingState(text: 'foo bar baz', baseOffset: 11, extentOffset: 11));
input.dispatchEvent(createDomEvent('Event', 'input'));
expect(editingStrategy?.editingDeltaState.oldText, 'foo bar baz');
});
});
Expand Down