Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 37514af

Browse files
committed
Address nit
1 parent 69f5bfc commit 37514af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/web_ui/lib/src/engine/text_editing/text_editing.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,6 @@ abstract class DefaultTextEditingStrategy with CompositionAwareMixin implements
13611361
@override
13621362
void setEditingState(EditingState? editingState) {
13631363
lastEditingState = editingState;
1364-
_editingDeltaState = null;
13651364
if (!isEnabled || !editingState!.isValid) {
13661365
return;
13671366
}
@@ -1394,9 +1393,9 @@ abstract class DefaultTextEditingStrategy with CompositionAwareMixin implements
13941393
lastEditingState = newEditingState;
13951394
_editingDeltaState = newTextEditingDeltaState;
13961395
onChange!(lastEditingState, _editingDeltaState);
1397-
// Flush delta after it has been sent to framework.
1398-
_editingDeltaState = null;
13991396
}
1397+
// Flush delta after it has been sent to framework.
1398+
_editingDeltaState = null;
14001399
}
14011400

14021401
void handleBeforeInput(DomEvent event) {

lib/web_ui/test/engine/text_editing_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2810,6 +2810,7 @@ Future<void> testMain() async {
28102810
expect(editingStrategy!.editingDeltaState.oldText, 'foo bar');
28112811

28122812
editingStrategy!.setEditingState(EditingState(text: 'foo bar baz', baseOffset: 11, extentOffset: 11));
2813+
input.dispatchEvent(createDomEvent('Event', 'input'));
28132814
expect(editingStrategy?.editingDeltaState.oldText, 'foo bar baz');
28142815
});
28152816
});

0 commit comments

Comments
 (0)