Skip to content

Commit

Permalink
Merge pull request #12513 from Puneet-here/add-autoFocus
Browse files Browse the repository at this point in the history
Add auto focus to routing number field
  • Loading branch information
MonilBhavsar authored Nov 10, 2022
2 parents 599f1b9 + f971bdb commit 0de35b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libs/shouldDelayFocus/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// When using transitions on Android, we need to delay focusing the text inputs for the keyboard to open.
export default true;
1 change: 1 addition & 0 deletions src/libs/shouldDelayFocus/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default false;
3 changes: 3 additions & 0 deletions src/pages/ReimbursementAccount/BankAccountManualStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import ONYXKEYS from '../../ONYXKEYS';
import exampleCheckImage from './exampleCheckImage';
import Form from '../../components/Form';
import * as ReimbursementAccountUtils from '../../libs/ReimbursementAccountUtils';
import shouldDelayFocus from '../../libs/shouldDelayFocus';

const propTypes = {
...withLocalizePropTypes,
Expand Down Expand Up @@ -92,6 +93,8 @@ class BankAccountManualStep extends React.Component {
source={exampleCheckImage(this.props.preferredLocale)}
/>
<TextInput
autoFocus
shouldDelayFocus={shouldDelayFocus}
inputID="routingNumber"
label={this.props.translate('bankAccount.routingNumber')}
defaultValue={ReimbursementAccountUtils.getDefaultStateForField(this.props, 'routingNumber', '')}
Expand Down

0 comments on commit 0de35b9

Please sign in to comment.