Skip to content

Conversation

@xu-baolin
Copy link
Member

@xu-baolin xu-baolin commented Oct 12, 2020

Description

Fix a regressing bug introduced by 0d945a1

The engine was not notified when the formatter repeatedly format.

So sorry to introduced this bug, I added a test case to ensure that no mistake will be made again.

@justinmc @LongCatIsLooong please review, thanks.

Related Issues

Fixes #67828
Fixes #67236
Fixes #67262
Fixes #67895

Tests

I added the following tests:

"Send text input state to engine when the input formatter rejects user input" in editable text test.

@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Oct 12, 2020
@google-cla google-cla bot added the cla: yes label Oct 12, 2020
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix!

// Setting _value here ensures the selection and composing region info is passed.
_value = value;
if (value == _value) {
// Please note that the setter will not notify subscribers if set duplicate values.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: according to the style guide we should try to avoid empty prose, it applies to code comments as well.

);
});

testWidgets('Synchronous test of local and remote editing values (#2)', (WidgetTester tester) async {
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 call this 'Send text input state to engine when the input formatter rejects user input'.

expect(
methodCall,
isMethodCall('TextInput.setEditingState', arguments: <String, dynamic>{
'text': 'Flutter is the best!',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if we only care about the text value here we can just say containsPair('text, 'Flutter is the best!'),. See https://api.flutter.dev/flutter/package-matcher_matcher/containsPair.html

Copy link
Member

@AlexV525 AlexV525 left a comment

Choose a reason for hiding this comment

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

LGTM (as per @LongCatIsLooong ). The CI is complaining but it seems related with network. If it continues to failed, please merge new commits from master and try again.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the quick fix. It looks like the tests are passing so this can be merged when the build is green.

@Knupper
Copy link

Knupper commented Oct 22, 2020

Will we see this fix as an hotfix in flutter 1.22.3?

@AlexV525
Copy link
Member

Just added an request in #67828 .

christopherfujino pushed a commit to chris-forks/flutter that referenced this pull request Oct 28, 2020
christopherfujino added a commit that referenced this pull request Oct 29, 2020
* Fix TextField bug when the formatter repeatedly format (#67892)
* Adjust constraints (#68437)
* update engine

Co-authored-by: xubaolin <[email protected]>
Co-authored-by: Michael Thomsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

6 participants