Skip to content
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 type? #4

Closed
timdoes opened this issue Apr 3, 2015 · 4 comments
Closed

Password field type? #4

timdoes opened this issue Apr 3, 2015 · 4 comments

Comments

@timdoes
Copy link

timdoes commented Apr 3, 2015

Awesome plugin!

Is there a way to set a field type as password so the characters become dotted out and not viewable while typing?

Thanks,
-Tim

@gcanti
Copy link
Owner

gcanti commented Apr 3, 2015

It will lend soon: secureTextEntry facebook/react-native#265

@timdoes
Copy link
Author

timdoes commented Apr 6, 2015

Is my structure or syntax incorrect for this?

var options = {
fields: {
password: {
password: true,
secureTextEntry: true,
}
}
};

On Sun, Apr 5, 2015 at 10:24 AM, Giulio Canti [email protected]
wrote:

Closed #4 #4 via
6a61000
6a61000
.


Reply to this email directly or view it on GitHub
#4 (comment).

@gcanti
Copy link
Owner

gcanti commented Apr 6, 2015

It seems ok. This is my test case and it works (tcomb-form-native v0.1.6, react-native v0.3.4):

var Type = t.struct({
  password: t.Str
});

var options = {
  fields: {
    password: {
      password: true,
      secureTextEntry: true
    }
  }
};

var AwesomeProject = React.createClass({

  onPress: function () {
    var value = this.refs.form.getValue();
    if (value) {
      console.log(value);
    }
  },

  render: function() {
    return (
      <View style={styles.container}>
        <Form
          ref="form"
          type={Type}
          options={options}
        />
        <TouchableHighlight style={styles.button} onPress={this.onPress} underlayColor='#99d9f4'>
          <Text style={styles.buttonText}>Save</Text>
        </TouchableHighlight>
      </View>
    );
  }
});

@fedecaccia
Copy link

which is the 'password' option used for? is not enough with secureTextEntry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants