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

Add auto focus to routing number field #12513

Merged
merged 4 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
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;
Puneet-here marked this conversation as resolved.
Show resolved Hide resolved
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