gabrieldonadel / rn-material-ui-textfield

Material UI textfield
https://www.npmjs.com/package/rn-material-ui-textfield
Other
37 stars 31 forks source link

error styling #12

Open alz10 opened 3 years ago

alz10 commented 3 years ago

I'd like to put some padding bottom on the text error so that it wont look confusing to the next textfield

gabrieldonadel commented 3 years ago

@alz10 Could you share your code for this screen?

alz10 commented 3 years ago

@gabrieldonadel

import React, { Component } from 'react'
import { OutlinedTextField } from 'rn-material-ui-textfield'

class Example extends Component {
 ........
  render() {
    return (
     <View>
       <OutlinedTextField label="Full Name" error={errors.fullname}" />
       <OutlinedTextField label="Emaill Address" error={errors.email} />
     </View>
    )
  }
}

I just wanna add some marginBottom when the error text appears so it doesn't get closer to another textfield's title specially in OutlinedTextField.

A prop errorStyle or errorComponent to fully customize the error text according to our desire design

Screenshot_2021-01-09-09-03-21-605_com lyqa cscreviewer

Diwakar14 commented 3 years ago

You can apply some marginBottom on First input fields.

to make the appropriate spacing

alz10 commented 3 years ago

@Diwakar14

I already did that and yes it fixes the spacing problem but what if i want to fully customize the error text? For example i want to add an icon right beside it or make it a message badge. A prop errorStyle or renderErrorComponent is what makes it flexible. I hope @gabrieldonadel support it in the next updates....

gabrieldonadel commented 3 years ago

@alz10 I'll do some experiments with a renderErrorComponent prop and I'll let you know once I have a stable version.