Block invalid input of temperature value

This commit is contained in:
Sofiya Tepikin
2021-01-13 21:14:06 +01:00
parent f1f18e6f93
commit 9dee0bd443
+6 -1
View File
@@ -50,7 +50,12 @@ class Temperature extends Component {
}
onChangeTemperature = (value) => {
this.setState({ value, shouldShowSuggestion: false })
if (!Number(value)) return false
this.setState({
value: value.trim(),
shouldShowSuggestion: false
})
}
onShowTimePicker = () => {