Adding handling of TextInputClient.onConnectionClosed messages handli…#43466
Adding handling of TextInputClient.onConnectionClosed messages handli…#43466nturgut merged 11 commits intoflutter:masterfrom
Conversation
mdebbar
left a comment
There was a problem hiding this comment.
Thanks for tackling this!
Could you please double-check that this PR doesn't introduce the same regressions that caused the other PR to be reverted? cc @matthew-carroll
|
I think we may have said we were waiting for new test infra to attempt another solution to this due to the nuanced ways a fix might introduce new bugs, but I'll defer to @HansMuller @gspencergoog and @collinjackson on that topic. |
|
@matthew-carroll From the comments on #39523 it sounded like the issue that caused the rollback was how we send this event from Android? |
fbc80b9 to
b79771a
Compare
|
We chat with @matthew-carroll and @gspencergoog, and decided to continue with the framework change for now. Android change will follow when the integration tests for testing the behavior is supported. |
|
@nturgut the update here based on @xster's comment is that if we prioritize this for the upcoming code freeze then we will probably have to implement the Android fix before we have new testing infra. I think web can continue as discussed, but we may be bringing in the Android side earlier than anticipated. |
mdebbar
left a comment
There was a problem hiding this comment.
LGTM with some comments about the tests.
goderbauer
left a comment
There was a problem hiding this comment.
Approach looks good.
Added some comments about documentation. Since the text connection is a delicate dance between framework and engine to keep everything in sync we should document very clearly how things are intended to be used.
dnfield
left a comment
There was a problem hiding this comment.
This appears to re-introduce bugs for Android from the linked PR.
We should not land this without a test asserting that text input works as expected on Android with these changes.
We already discussed it with @matthew-carroll @goderbauer @gspencergoog it is safe to land |
…e tests. Added comments to the interfaces.
goderbauer
left a comment
There was a problem hiding this comment.
This looks fine (modulo the breaking change requirements).
However, there are two similar PRs out now. The other one is #43959. Just to double check: Do the addressed use cases really need two new APIs?
| /// | ||
| /// * `TextInputClient.onConnectionClosed`: The text input connection closed | ||
| /// on the platform side. For example the application is moved to | ||
| /// background or used closed the virtual keyboard. This method informs |
There was a problem hiding this comment.
used? Oh, maybe "the user closed..."?
| /// on the platform side. For example the application is moved to | ||
| /// background or used closed the virtual keyboard. This method informs | ||
| /// [TextInputClient] to clear connection and finalize editing. | ||
| /// `TextInput.clearClient` and `TextInput.hide` is not called after |
There was a problem hiding this comment.
is not called -> must not be called?
|
Please link the breaking change announcement from the PR description. |
Done! Thanks. |
flutter#43466) * Adding handling of TextInputClient.onConnectionClosed messages handling to Framework * Adding more test cases for closing connection to editable_text_test * fixing analyze error. * Fixing analyze error in the test file * Fixing comments on the new method * Adding more closing connection examples. * Indentation change * Remove auto-add white space * Changing the oncloseconnection behaviour to stop editing. Updating the tests * Addressing PR comments. Added explicit log for method channnels to the tests. Added comments to the interfaces. * add more documentation
Adding handling of TextInputClient.onConnectionClosed messages handling to Framework
Description
Adding a message to the Flutter Framework for clients to call if a connection is closed.
Information in following situations can be synced with the framework using this method call.
This PR is merged and rolled back before: #35100
Related Issues
#43034
Tests
I added the following tests:
Manually tested with the Flutter Web Engine.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?
Announcement: https://groups.google.com/forum/#!topic/flutter-announce/IwG8xGA7Kmo