Skip to content
Snippets Groups Projects
Commit 7725f1be authored by Julia Friesel's avatar Julia Friesel
Browse files

Limit length

parent 0878135a
No related branches found
No related tags found
No related merge requests found
......@@ -70,21 +70,25 @@ export default class Temp extends Component {
<TextInput
style={styles.temperatureTextInput}
onChangeText={(val) => {
if (isNaN(Number(val))) return
this.setState({ integer: val })
}}
keyboardType='numeric'
value={this.state.integer}
onBlur={this.checkRange}
maxLength={2}
/>
<Text style={styles.temperatureTextInput}>.</Text>
<TextInput
style={styles.temperatureTextInput}
onChangeText={(val) => {
if (isNaN(Number(val))) return
this.setState({ fractional: val })
}}
keyboardType='numeric'
value={this.state.fractional}
onBlur={this.checkRange}
maxLength={2}
autoFocus={true}
/>
</View>
</View>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment