-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Don't overwrite editing state with semantic updates #38271
[web] Don't overwrite editing state with semantic updates #38271
Conversation
@@ -159,7 +159,6 @@ void testMain() { | |||
expect(domDocument.activeElement, flutterViewEmbedder.glassPaneElement); | |||
expect(appHostNode.activeElement, strategy.domElement); | |||
expect(textField.editableElement, strategy.domElement); | |||
expect((textField.editableElement as dynamic).value, 'hello'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This expectation used to verify that the semantics text value gets updated when the framework begins editing a text field. I think to cover that with the new approach we need a new test (or maybe just add it to this test) that sends the text editing state through the text input channel and checks that the editing state is applied to textField.editableElement
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. I wrote it this way because we're delegating the responsibility of editing state updates to text_editing.dart
, so it seems like the best place to test framework -> engine editing state updates would be in text_editing_test.dart
which has existing tests that verify that behavior.
But is the idea here that we want to explicitly test whether that behavior applies specifically to semantic nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to test the behavior of text_editing.dart
when using a semantics editing strategy to make sure that the element's value is still being updated correctly.
}); | ||
|
||
test( | ||
'Updates editing state when receiving framework messages from the text input channel', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…117330) * 4a3a0ec67 pylint scripts under sky, remove dead scripts under sky/tools/roll (flutter/engine#38334) * 45713ea10 [web] Don't overwrite editing state with semantic updates (flutter/engine#38271)
…utter#38271)" (flutter#38562) This reverts commit 45713ea.
…lutter#117330) * 4a3a0ec67 pylint scripts under sky, remove dead scripts under sky/tools/roll (flutter/engine#38334) * 45713ea10 [web] Don't overwrite editing state with semantic updates (flutter/engine#38271)
…ates (flutter#38271)" (flutter#38562)" (flutter#38854) This reverts commit 5713a21.
We currently handle syncing text input editing state updates in 2 places:
text_editing.dart
(non-semantic path) andtext_field.dart
(semantic mode path). This redundancy is causing several text input issues in semantic mode, especially as it relates to text field value and selection state. Delegating this responsibility solely totext_editing.dart
will fix this.Fixes flutter/flutter#107634
Fixes flutter/flutter#90794
Pre-launch Checklist
///
).