From a2ed103cef0637876f3e851f1642204f38aac1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Tue, 29 Jan 2019 22:46:32 -0500 Subject: [PATCH] FIX: If slider value < 1, force it to 1. --- .flowconfig | 2 +- screen/send/details.js | 17 ++++++++++++----- screen/wallets/add.js | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.flowconfig b/.flowconfig index f3eb74de..9bded78b 100644 --- a/.flowconfig +++ b/.flowconfig @@ -67,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.85.0 +^0.86.0 diff --git a/screen/send/details.js b/screen/send/details.js index 3058152b..42f4e0c0 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -392,7 +392,12 @@ export default class SendDetails extends Component { this.setState({ isFeeSelectionModalVisible: false })} + onBackdropPress={() => { + if (this.state.fee < 1 || this.state.feeSliderValue < 1) { + this.setState({ fee: Number(1), feeSliderValue: Number(1) }); + } + this.setState({ isFeeSelectionModalVisible: false }); + }} > @@ -403,12 +408,14 @@ export default class SendDetails extends Component { this.textInput = ref; }} value={this.state.fee.toString()} + onEndEditing={() => { + if (this.state.fee < 1 || this.state.feeSliderValue < 1) { + this.setState({ fee: Number(1), feeSliderValue: Number(1) }); + } + }} onChangeText={value => { let newValue = value.replace(/\D/g, ''); - if (newValue.length === 0) { - newValue = 1; - } - this.setState({ fee: newValue, feeSliderValue: newValue }); + this.setState({ fee: Number(newValue), feeSliderValue: Number(newValue) }); }} maxLength={9} editable={!this.state.isLoading} diff --git a/screen/wallets/add.js b/screen/wallets/add.js index 1ecc9dc7..db8ac57e 100644 --- a/screen/wallets/add.js +++ b/screen/wallets/add.js @@ -98,6 +98,7 @@ export default class WalletsAdd extends Component { onChangeText={text => { this.setLabel(text); }} + autoFocus style={{ flex: 1, marginHorizontal: 8, color: '#81868e' }} editable={!this.state.isLoading} underlineColorAndroid="transparent"