Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ios17][text_input]fix ios 17.0 keyboard freeze when switching langua…
…ges (without relying on text affinity) (#47566) After close examination of the UIKit's default string tokenizer, when querying the line enclosing the end of doc position **in forward direction**, we should return nil (regardless whether the position is forward or backward affinity). This aligns with the [API doc](https://developer.apple.com/documentation/uikit/uitextinputtokenizer/1614464-rangeenclosingposition?language=objc): > If the text position is at a text-unit boundary, it is considered enclosed only if the next position in the given direction is entirely enclosed. Will cherry pick this soon. Otherwise it will be less and less important as users upgrade to iOS 17.1. ### Why my previous workaround also works? It turns out my previous workaround PR #46591 works only because our misuse of text affinity in our text input. Specifically, when adding text affinity support, we only added it to `FlutterTextPosition`, but not `FlutterTextRange`. So when getting the beginning/end position from the range, we assign arbitrary affinities. *List which issues are fixed by this PR. You must list at least one issue.* #46591 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
- Loading branch information