Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep textinput focused if no amount is entered #9064

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ class IOUModal extends Component {
hasMultipleParticipants={this.props.hasMultipleParticipants}
selectedAmount={this.state.amount}
navigation={this.props.navigation}
iouType={this.props.iouType}
/>
</AnimatedStep>
)}
Expand Down
9 changes: 6 additions & 3 deletions src/pages/iou/steps/IOUAmountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,11 @@ class IOUAmountPage extends React.Component {
styles.justifyContentCenter,
]}
>
<TouchableOpacity onPress={() => Navigation.navigate(this.props.hasMultipleParticipants
? ROUTES.getIouBillCurrencyRoute(this.props.reportID)
: ROUTES.getIouRequestCurrencyRoute(this.props.reportID))}
<TouchableOpacity onPress={() => {
if (this.props.hasMultipleParticipants) { return Navigation.navigate(ROUTES.getIouBillCurrencyRoute(this.props.reportID)); }
if (this.props.iouType === CONST.IOU.IOU_TYPE.SEND) { return Navigation.navigate(ROUTES.getIouSendCurrencyRoute(this.props.reportID)); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sobitneupane please bring the return statements to a new line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

return Navigation.navigate(ROUTES.getIouRequestCurrencyRoute(this.props.reportID));
}}
>
<Text style={styles.iouAmountText}>
{lodashGet(this.props.currencyList, [this.props.iou.selectedCurrencyCode, 'symbol'])}
Expand All @@ -236,6 +238,7 @@ class IOUAmountPage extends React.Component {
value={formattedAmount}
placeholder={this.props.numberFormat(0)}
keyboardType={CONST.KEYBOARD_TYPE.NUMBER_PAD}
blurOnSubmit={this.state.amount !== ''}
Copy link
Member

@rushatgabhane rushatgabhane May 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sobitneupane can we keep blurOnSubmit always as true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are trying to make blurOnSubmit false when there is no amount to proceed to next step.
If You mean to keep it always false, I am not sure. I avoid it thinking it might cause regression.

Copy link
Member

@rushatgabhane rushatgabhane May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not add extra logic if it isn't needed.

The keyboard isn't open on this page, so it should be fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and pushed the change. Working fine in my side. Please test it in your side as well.

Copy link
Member

@rushatgabhane rushatgabhane May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for testing it

/>
</View>
<View style={[styles.w100, styles.justifyContentEnd]}>
Expand Down