-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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 default for underlineColorAndroid transparent #18938
Comments
How about just making it underlineColor (with transparent default) and make it so it just adds a border bottom on iOS? I tend to underline most of my textinputs but always just make the android underline transparent so I can share the style for both platforms. I realise this does increase complexity of the issue but it feels like if you set this to transparent then it's very rarely going to be used and people are only ever going to set a borderBottom. |
@joefazz I think the underline is more of a material design thing, and poly-filling it on iOS is out of this scope. It's actually a bit different than border, both in the way it is positioned and is affected by focus. Also it could lead to some weird things if someone uses both border and underlineColor. |
It’s worth pointing out this that API doesn’t produce an underline compatible with the Material design spec for form inputs. So right now, any dev who is trying to implement material is also setting this prop to transparent and doing all the work on top of a blank slate. |
I am willing to work on this one as a first issue. |
@mikaoelitiana Cool! You can mention me in the PR and I'll have a look. |
Summary: Set default `underlineColorAndroid` to `transparent`. <!-- Required: Write your motivation here. If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged. --> Fixes facebook#18938 <!-- Required: Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos! --> Use a TextInput in a component without defining `underlineColorAndroid`, the underline color should be transparent. <!-- Does this PR require a documentation change? Create a PR at https://github.com/facebook/react-native-website and add a link to it here. --> <!-- Required. Help reviewers and the release process by writing your own release notes. See below for an example. --> [ANDROID] [BREAKING] [TextInput] - set default underlineColorAndroid to transparent <!-- **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [ {Component} ] [ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> Closes facebook#18988 Reviewed By: mdvacca Differential Revision: D7765569 Pulled By: yungsters fbshipit-source-id: f7ad57a46fc0d18b47271ca39faae8c635995fbb
@janicduplessis @mikaoelitiana with this commit, the underline color doesn't change to My RN version is 0.58.3. |
@shubhnik you can get back the old behaviour by setting.
See more this comment for more finding of mine on this. Or in case you want to actually patch this globally:
I am applying this in my |
https://twitter.com/notbrent/status/986843528004292608
This will help reduce differences between iOS and Android, the default style is actually kind of broken right now because we no longer add extra padding on Android.
Before:
After:
The easiest implement this might be just to add
underlineColorAndroid: 'transparent'
to TextInput default props.The text was updated successfully, but these errors were encountered: