-
Notifications
You must be signed in to change notification settings - Fork 458
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
password field no longer hides input #39
Comments
This is my test case and it works fine:
Which version of react-native are you using? 'use strict';
var React = require('react-native');
var t = require('.');
var stylesheet = require('./lib/stylesheets/bootstrap');
var {
AppRegistry,
StyleSheet,
Text,
View,
TouchableHighlight,
TextInput
} = React;
var Form = t.form.Form;
var Credentials = t.struct({
username: t.Str,
password: t.Str
});
var AwesomeProject = React.createClass({
getInitialState() {
return {
value: {},
options: {
fields: {
password: {
label: 'mylabel',
placeholder: 'my placeholder',
error: 'my error',
password: true
}
}
}
};
},
onChange(value) {
this.setState({value});
},
onPress() {
var value = this.refs.form.getValue();
if (value) {
console.log(value);
}
},
render() {
return (
<View style={styles.container}>
<Form
ref="form"
type={Credentials}
options={this.state.options}
value={this.state.value}
onChange={this.onChange}
/>
<TouchableHighlight style={styles.button} onPress={this.onPress} underlayColor='#99d9f4'>
<Text style={styles.buttonText}>Save</Text>
</TouchableHighlight>
</View>
);
}
});
var styles = StyleSheet.create({
container: {
flex: 1,
marginTop: 50,
padding: 20,
//backgroundColor: '#333333'
backgroundColor: '#ffffff'
},
title: {
fontSize: 30,
alignSelf: 'center',
marginBottom: 30
},
buttonText: {
fontSize: 18,
color: 'white',
alignSelf: 'center'
},
button: {
height: 36,
backgroundColor: '#48BBEC',
borderColor: '#48BBEC',
borderWidth: 1,
borderRadius: 8,
marginBottom: 10,
alignSelf: 'stretch',
justifyContent: 'center'
}
});
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); |
Hmm, weird. I'm on |
@mschipperheyn you need to add secureTextEntry so it looks like this password: {
password: true,
secureTextEntry: true
} |
ah ok. I wasn't aware of that. Ah, ok. This allows you to implement a "show password" feature |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just upgraded to 0.2.2 and I noticed that the password field doesn't seem to hide input anymore. My config:
The text was updated successfully, but these errors were encountered: