Comments (4)
This is my test case and it works fine:
- tcomb-form-native v0.2.2
- react-native v0.5.0
- XCode 6.2
- IOS Simulator 8.2 (iPhone 6)
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);
from tcomb-form-native.
Hmm, weird. I'm on
react-native v.0.6.0 (the problem occurred after upgrading)
IOS Simulator 8.2 (iPhone 6, tried a variety of deployment targets)
from tcomb-form-native.
@mschipperheyn you need to add secureTextEntry so it looks like this
password: {
password: true,
secureTextEntry: true
}
from tcomb-form-native.
ah ok. I wasn't aware of that. Ah, ok. This allows you to implement a "show password" feature
from tcomb-form-native.
Related Issues (20)
- Contact us form ?
- Styling error fields
- Terms validation ?
- Keep entered values after error HOT 1
- how we set height to input box? HOT 1
- numberOfLines is not working HOT 1
- Changing the placeholder for datetimepicker from Tap here to select a date to Start Date for example
- Unable to resolve "tcomb-form.native" from "app\components\forms\testForm.js"
- I've got error message when I try expo start --web HOT 1
- componentWillReceiveProps
- TypeError: locals.value.toDateString is not a function when trying to use value prop HOT 1
- Need more control over opening and closing of iOS Select component
- Does tcomb-form-native support async verification?
- iOS 14: Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`
- custom stylesheets does not apply to optional field title
- Problem with submit form HOT 1
- how to add BUTTON IN BETWEEN the form fields
- Please delete
- react native t comb form ERROR Warning: Component "Textbox" contains the string ref "input". React.createRef() HOT 2
- WARNING: This library will no longer work with React Native after version 0.65 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcomb-form-native.