You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SelectableText] inconsistent selection background color between different character encoding #68675
Select text when text containing English and Chinese, the selection color isn't cover the all the text while part of it is smaller if English is selected while another part of it is bigger if Chinese is selected.
@SeasonLeee
It's probably the way the selection toolbar works depending on the language and it's height. Since the English letters are a bit smaller than Chinese characters, it interprets and selects based on the height. As an example, Russian is same height as English, so the selection height would be same, but if you see the chinese characters, they are bigger and hence the difference.
Yeah, it could be, but I can't be sure the code to paint that background color, could you point me to the file that control the painting? thanks! @darshankawar
@darshankawar oh, man, it's too much... 😅... I just tried to track down something related to SelectableText... but... ugh... I feel like I'm lost in the jungle...😅, thanks, though...
I also noticed that selectionHeightStyle : BoxHeightStyle.max should be the default one in Cupertino. Now all EditableText default to selectionHeightStyle : BoxHeightStyle.tight
@jamesblasco Wow! words are useless when I want to use them to express my amazement on how quick you locate the cause was!!!! Man, you are brilliant!!! And huge thank you for check this out!!!!!!!!!!!!
And yes, I agree with that we should expose the setting of selectionHeightStyle or at least make it default to BoxHeightStyle.max instead of the original BoxHeightStyle.tight
Although, the reason why tight is the default maybe the fact that there's some problem with max when the text has change into new line if I understand correctly?
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
darshankawar commentedon Oct 21, 2020
@SeasonLeee
Please provide
flutter doctor -vand a complete minimal reproducible code sample that shows the issue.Thanks.
renntbenrennt commentedon Oct 21, 2020
No problem, here's the

flutter doctor -v:And I don't think this issue is sdk specific, it's been there for a while I just don't have the time to open a issue to talk about it, thanks
darshankawar commentedon Oct 21, 2020
@SeasonLeee
It's probably the way the selection toolbar works depending on the language and it's height. Since the English letters are a bit smaller than Chinese characters, it interprets and selects based on the height. As an example, Russian is same height as English, so the selection height would be same, but if you see the chinese characters, they are bigger and hence the difference.
renntbenrennt commentedon Oct 21, 2020
Yeah, it could be, but I can't be sure the code to paint that background color, could you point me to the file that control the painting? thanks! @darshankawar
darshankawar commentedon Oct 21, 2020
@SeasonLeee
Check this if it helps.
renntbenrennt commentedon Oct 21, 2020
@darshankawar oh, man, it's too much... 😅... I just tried to track down something related to SelectableText... but... ugh... I feel like I'm lost in the jungle...😅, thanks, though...
jamesblasco commentedon Oct 21, 2020
I think this would be possible to edit by using the param
selectionHeightStyle : BoxHeightStyle.maxinEditableText;flutter/packages/flutter/lib/src/widgets/editable_text.dart
Lines 1161 to 1164 in 955e074
Sadly this param is not accessible from SelectableText, TextField, TextFormField, CupertinoTextField.'
@justinmc, What would you think about adding this param to the TextSelectionThemeData?
I also noticed that
selectionHeightStyle : BoxHeightStyle.maxshould be the default one in Cupertino. Now all EditableText default toselectionHeightStyle : BoxHeightStyle.tightApple Mail App:
renntbenrennt commentedon Oct 21, 2020
@jamesblasco Wow! words are useless when I want to use them to express my amazement on how quick you locate the cause was!!!! Man, you are brilliant!!! And huge thank you for check this out!!!!!!!!!!!!
And yes, I agree with that we should expose the setting of
selectionHeightStyleor at least make it default toBoxHeightStyle.maxinstead of the originalBoxHeightStyle.tightAlthough, the reason why
tightis the default maybe the fact that there's some problem withmaxwhen the text has change into new line if I understand correctly?As stated in the codebase's comment:

19 remaining items
mafreud commentedon Aug 6, 2024
Is it okay to set
selectionHeightStyle : BoxHeightStyle.includeLineSpacingMiddleas a default?Update default `selectionHeightStyle` and `selectionWidthStyle` for `…
github-actions commentedon Jul 1, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.Update default `selectionHeightStyle` and `selectionWidthStyle` for `…