diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index 6d3a37270af34e08ba5c488dee5394f437040e92..9a5efc22ea7638d50efd0c56a00a64e54ef2321a 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -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>