-
Notifications
You must be signed in to change notification settings - Fork 27.2k
-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
'textSelectionHandleColor' doesn't work for iOS whereas 'textSelectionColor' works for both platforms #43887
Comments
In this case the TextField's adaptation for iOS is intended to be faithful to the native look and feel for the text selection, rather than to the Material theme. Maybe we need a way to override that. |
If it's intended to be faithful to iOS, I would expect that either both of the mentioned properties work or both don't. I would also suggest making this behavior more explicit by putting a corresponding comment on the color/colors. |
Code Sample
flutter doctor -v
flutter doctor -v
|
I can see that @LongCatIsLooong has added the follow line on 8/10/2020 on master.
I tried to over write it like this. but it didn't work (on the master branch)
|
@vanlooverenkoen Try setting the For example
For some reason, IOS ignores the Material defined values. |
cc @justinmc Did you want to take a look at this? This doesn't look like it needs much code changes, but more of a policy decision on whether to set the textSelectionHandleColor in the Cupertino theme derivation of Material theme. |
@darrenaustin I believe you were working on TextSelectionTheme, did you have any opinion on how iOS should use those settings? I think I'm leaning towards iOS-style text selection using only Cupertino theme values. That would mean updating it so that textSelectionColor has no effect on iOS. iOS text selection is mostly defined in cupertino/text_selection.dart, which doesn't have access to the Material library's theming. I'm not sure how we plan to handle this kind of theming for other platforms, though. I can open a quick PR to disable textSelectionColor on iOS if no one objects. |
@justinmc I think that would be a better option. Said that, the Said that, we should file another issue for improving the docs to mention this behavior. Happy to file and raise a PR, if we are on same page. |
I don't have a strong opinion on whether we should allow the material theme settings should apply to textfields on iOS, but we should be consistent. It looks like two of the I am not that familiar with how the text selection handles are implemented for Cupertino. Would it be hard to have them use the material theme data for this to be consistent? |
I think it would be hard for CupertinoTextField, because CupertinoTextField can't access the Material theme. @AyushBherwani1998 I'm on board with just updating the docs if you're still able to write a pull request. |
@justinmc I'll send a PR soon to update docs. |
This issue is assigned but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks! |
This issue was assigned to @AyushBherwani1998 but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed. |
It looks like this should have been closed with #75967. |
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 |
Steps to Reproduce
Target Platform: iOS
Devices: Simulator (iPhone 11 - 13.1), iPhone 8 - 13.1.3
Logs
I dug into the sources of flutter a bit and saw the following:
material 'text_selection.dart' uses the theme's value
whereas cupertino 'text_selection.dart' has the hardcoded color value
Shouldn't the text selection handles on iOS be affected by 'textSelectionHandleColor' value?
The text was updated successfully, but these errors were encountered: