-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Fix TextField bug when the formatter repeatedly format #67892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LongCatIsLooong
left a comment
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. 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. |
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.
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 { |
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.
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!', |
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.
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
AlexV525
left a comment
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 (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.
justinmc
left a comment
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, thanks for the quick fix. It looks like the tests are passing so this can be merged when the build is green.
|
Will we see this fix as an hotfix in flutter 1.22.3? |
|
Just added an request in #67828 . |
* 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]>
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.