Tcomb-form-native: Remove unnecessary bottom border Android from default style

Created on 27 Sep 2016  路  24Comments  路  Source: gcanti/tcomb-form-native

Version

Tell us which versions you are using:

  • tcomb-form-native v0.6.1
  • react-native v0.34.0

Every TextInput has unnecessary bottom border after RN34

https://github.com/facebook/react-native/issues/10108

input

we should set underlineColorAndroid='transparent' as the default

Most helpful comment

But it should. This is what I have in my options as well:

{
        stylesheet: stylesheet,
        auto: 'none',
        fields: {
            name: {
                placeholder: 'Name',
                underlineColorAndroid: 'transparent',
            },

and it works...

All 24 comments

Hi @sibelius!

Thanks for reporting this. Can you send a PR? 馃槃

Many thanks!

I've added there, but I'm receiving an error

invalid props.style key underlineColorAndroid supplied to TextInput

I'm working on the same thing.
underlineColorAndroid is not a style property, but a property of TextInput. You'll have to pass it in your options for the field...

@alvaromb - maybe we should make a global property for the options underlineColorAndroid that would be automatically applied to all fields?

I'm in for maintaining the actual behaviour, add it to the options of the text field.

how can I solve this problem right now?

I've tried this

const options = {
      auto: 'placeholders',
      fields: {
        email: {
          maxLength: 250,
          autoCorrect: false,
          keyboardType: 'email-address',
          autoCapitalize: 'none',
         underlineColorAndroid: 'transparent',
          onSubmitEditing: () => this.refs.form.getComponent('password').refs.input.focus()
        },
        password: {
          maxLength: 70,
          secureTextEntry: true,
         underlineColorAndroid: 'transparent',
          error: 'Must have 6-12 characters with at least 1 number and 1 special character'
        }
      }
    };

but it did not worked

But it should. This is what I have in my options as well:

{
        stylesheet: stylesheet,
        auto: 'none',
        fields: {
            name: {
                placeholder: 'Name',
                underlineColorAndroid: 'transparent',
            },

and it works...

I did a clean install, and worked well, tks

@alvaromb I just feel that underlineColorAndroid: 'transparent', should be the default, but style is just a matter of taste

feel free to close this issue if u wanna keep the current defaults

The problem with this not being the default is that the style on android looks bad.

But it's hard to make it default as it is not a style property. So maybe updating the docs would solve the issue. I'm sure that there a lot of users out there, that have no clue why the form looks bad on android out of the box :(

You are talking about adding a default, so is not a breaking change, right?
What are the possibile issues of adding a default to underlineColorAndroid?

it is not a breaking change

the only issue is that it will not show the underlineColor on android as it was the behavior before RN34

Let me understand, if we add underlineColorAndroid = 'transparent' as a default, will users of < RN34 be affected in some way? If the answer is yes, it _is_ a breaking change and we should stick with the current behaviour

the answer is no

check this out - https://github.com/facebook/react-native/issues/10108

:+1: for being a default

Is there a way to set it as a global default without needing to add "underlineColorAndroid: 'transparent'' to the config for every field I create with tbomb-form-native? That would be really useful.

Great library btw!

I agree it shouldn't show the line by default.

I don't think this is a breaking change because it was transparent by default before 0.34.

馃憤 for setting underlineColorAndroid=' transparent as default, i.e. merging #254 . Also I agree with @cmrichards it would be nice to be able to change this prop globally.

you can set the underlineColorAndroid property to RGBA(0,0,0,0) as shown bellow

<TextInput underlineColorAndroid="rgba(0,0,0,0)"

Prop of the component TextInput
underlineColorAndroid="transparent"

This work for me!

capture _2018-09-20-15-00-49

capture _2018-09-20-15-01-04

In dark mode underlineColorAndroid="transparent" not working .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chauthai picture chauthai  路  4Comments

semirturgay picture semirturgay  路  4Comments

scarlac picture scarlac  路  4Comments

pgmemk picture pgmemk  路  4Comments

albertogugliotta picture albertogugliotta  路  3Comments