Skip to content

Commit e1dc845

Browse files
authored
Merge pull request #9064 from sobitneupane/sn_bug-iouamountpage-return-key-press
Keep textinput focused if no amount is entered
2 parents 9003b10 + 8a8c6c4 commit e1dc845

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/pages/iou/IOUModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,7 @@ class IOUModal extends Component {
417417
hasMultipleParticipants={this.props.hasMultipleParticipants}
418418
selectedAmount={this.state.amount}
419419
navigation={this.props.navigation}
420+
iouType={this.props.iouType}
420421
/>
421422
</AnimatedStep>
422423
)}

src/pages/iou/steps/IOUAmountPage.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,15 @@ class IOUAmountPage extends React.Component {
217217
styles.justifyContentCenter,
218218
]}
219219
>
220-
<TouchableOpacity onPress={() => Navigation.navigate(this.props.hasMultipleParticipants
221-
? ROUTES.getIouBillCurrencyRoute(this.props.reportID)
222-
: ROUTES.getIouRequestCurrencyRoute(this.props.reportID))}
220+
<TouchableOpacity onPress={() => {
221+
if (this.props.hasMultipleParticipants) {
222+
return Navigation.navigate(ROUTES.getIouBillCurrencyRoute(this.props.reportID));
223+
}
224+
if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) {
225+
return Navigation.navigate(ROUTES.getIouSendCurrencyRoute(this.props.reportID));
226+
}
227+
return Navigation.navigate(ROUTES.getIouRequestCurrencyRoute(this.props.reportID));
228+
}}
223229
>
224230
<Text style={styles.iouAmountText}>
225231
{lodashGet(this.props.currencyList, [this.props.iou.selectedCurrencyCode, 'symbol'])}
@@ -236,6 +242,7 @@ class IOUAmountPage extends React.Component {
236242
value={formattedAmount}
237243
placeholder={this.props.numberFormat(0)}
238244
keyboardType={CONST.KEYBOARD_TYPE.NUMBER_PAD}
245+
blurOnSubmit={false}
239246
/>
240247
</View>
241248
<View style={[styles.w100, styles.justifyContentEnd]}>

0 commit comments

Comments
 (0)