-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Make the text field cursor configurable #15571
Comments
Can you show a screenshot? Tested on the gallery though both just draw the caret by painting a Rect (0.0, 2.0, 1.0, 17.0) with the same color (0xff90caf9) and looks the same to me. cc @alardizabal who saw similar issues. |
Oops haven't checked in here for a while. @Hixie @xster this seem to still be an issue. At least with the Beta. Caret in Flutter is way thinner and shorter than in native apps. Also the color is not correct, at least for iOS. Providing a screen shot for comparison. Generally, the quality of the text fields is definitely the weakest thing in Flutter. I have a bunch of features that I'm holding off developing until the text fields feel more stable/native. |
Update: Also checked the native text inputs on Android, while they look wildly different in different apps, no-one matches Flutter. I figured that Chrome probably has the most standard one, which looks pretty similar to the one on iOS. Different apps also use different colors, so being able to choose a color would be nice. |
Ah I see. When you said short, I thought it was just #16257 though there are indeed other issues. Yes, the width does look different from the OS one. My suggestion is to also add cursor width to EditableText, then style it with a Cupertino TextField #13695. The |
Also cc @willlarche on whether a Material TextField should auto adapt text cursor color. It's currently |
Cursor color should always be either the active color or error color. See MDC-iOS. These colors are themeable. The active color should be the primary or primaryVariant color. The error color is the error color. See Color theme creation. If those values don't exist yet, consult with @HansMuller for short-term plan. |
Seems mostly compatible with native iOS. To make a Material analogy, the iOS cursor colors are mostly the primary color swatch colors. For instance, the App Store's nav bar buttons, the tab bar buttons and the cursor are all the same standard active blue color. The Health app also has all of its active colors in the same red color. Here, at least for the color, having the cursor color also be the theme's primary color seems sensible. In your example @vlidholt, the Gallery and the iOS notes app simply has different themes. We'll still want to have a configurable width however. |
@xster thanks for reopening this. If you look a bit more carefully you will also see that the height of the cursor is different (it's not just the height of the text, but maybe the full line height?) and that the iOS cursor has rounded edges. |
Makes sense, we should keep the height and the rounded corners in mind when adapting. |
In terms of code, we should start at Make sure the width is accounted for in In |
I am also going to add a parameter in the EditableText constructor for cursorHeight. Also, as a note, it looks like the active color for the cursor is different from the regular "activeBlue" color. Also, the cursor color is not always the active color or the error color. For example, in the native Notes app, the cursor color is orange. |
yes, it is done @xster |
@xster It would be helpful if it was in the Material |
cc @willlarche, @HansMuller. I don't see the cursor adaptability in the specs. Should we make this modification in the Material TextField? |
I think we should expose those properties in Material, yes. Also, listening to @droidery it sounds like the default values for them should be tweaked as well. If the spec does not have enough information, let me know and we can inspect the raw designs. |
This is blocking Mulligan. cc @johnfesa |
Sounds like @sandrasandeep is working on this (Material TextField) as of this morning. |
So far I have only found cursorWidth, cursorRadius and cursorColor in EditableText. When will cursorHeight be added? @sandrasandeep |
@panuavakul this issue is closed since a while. |
I can not find cursorHeight at EditableText widget.Is it merge to master or dev branch? |
There is no cursorHeight API. The general incorrect cursor height problem on non-latin scripts will be fixed separately in #20183 |
If you're still facing cursor height issues, please open a new issue. Please also note that it's worth checking on master again since we've fixed some line height issues on master since #27612. |
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
Go to the Text Fields demo in the Flutter Gallery. Type some text. Compare the text cursor to any other iOS app. The cursor in Flutter is too short and too thin.
Flutter Doctor
The text was updated successfully, but these errors were encountered: