evblurbs / react-native-md-textinput

React Native TextInput styled with Material Design.
322 stars 122 forks source link

Feature/unmask password #28

Open mlabrum opened 8 years ago

mlabrum commented 8 years ago

Hey,

I've added support to unmask the password field (opt in) https://material.google.com/components/text-fields.html#text-fields-password-input

output

it requires the user to supply the icon files that will be displayed (I didn't want to add a dependency to react native vector icons)

This is how its used

<TextInput
    label="Enter Password"
    secureTextEntry={true}
    value={this.state.text}
    onChangeText={(text) => this.setState({text: text})}
    secureTextAllowUnmask={true}
    secureTextAllowUnmaskIconOn={<Icon name="visibility"/>}
    secureTextAllowUnmaskIconOff={<Icon name="visibility-off"/>}
/>

this pull request is based from https://github.com/evblurbs/react-native-md-textinput/pull/23