Fix iOS word selection for CJK text - #3377
Kyle (Kyle-Ye) wants to merge 1 commit into
Conversation
|
Hi! Actually:
|
Vladimir Mazunin (@mazunin-v-jb) Thanks for pointing this out.
|
Thanks!
Yes, since it is a fork of an AOSP, no changes in commonMain are allowed at all, even the smallest diffs.
In case if rewriting won't work, this is a way. It should be enough to mention in the CL description that it is required for the multiplatform support. |
ef08e5c to
04cb1d5
Compare
|
Thanks for clarifying. I've removed all commonMain changes, including the visibility changes. The boundary-to-selection adapter now lives in iosMain and reuses the existing internal anchor APIs. |
On iOS, double-tapping
文in我在学习中文can select only文, whereas UIKitselects
中文. This PR aligns double-tap word selection in legacy and state-basedTextFields with iOS linguistic word boundaries using
NLTokenizer.When the tokenizer returns no word, selection falls back to the existing layout
word boundary, including for whitespace. Word-selection behavior on other
platforms remains unchanged.
TextLayoutResult.getWordBoundary()remains unchanged: replacing its boundarieswould also affect other selection, word-navigation, and deletion behavior. The
platform adjustment is applied specifically to iOS TextField repeated-tap selection.
Fixes CMP-10706.
This contribution was developed with AI assistance. The implementation, tests,
and behavior were reviewed, corrected, and validated by the author.
Testing
Local validation before submission:
offsets after an emoji, Latin words, and no-word results for whitespace.
NLTokenizercomparison tests passed.iOS 26.0: double-tapping
文in我在学习中文selects中文.Release Notes
Fixes - iOS
linguistic word boundaries.