From 4eaccadc9c04d199ce396f911c2e0ce4dd667339 Mon Sep 17 00:00:00 2001 From: puneet Date: Mon, 7 Nov 2022 19:32:17 -0800 Subject: [PATCH 1/4] add autoFocus to routing number field --- src/pages/ReimbursementAccount/BankAccountManualStep.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/ReimbursementAccount/BankAccountManualStep.js b/src/pages/ReimbursementAccount/BankAccountManualStep.js index d5f58071dc12..ef247e3d6b3e 100644 --- a/src/pages/ReimbursementAccount/BankAccountManualStep.js +++ b/src/pages/ReimbursementAccount/BankAccountManualStep.js @@ -92,6 +92,8 @@ class BankAccountManualStep extends React.Component { source={exampleCheckImage(this.props.preferredLocale)} /> Date: Mon, 7 Nov 2022 19:34:05 -0800 Subject: [PATCH 2/4] use platform dependent file --- src/libs/shouldDelayFocus/index.android.js | 2 ++ src/libs/shouldDelayFocus/index.js | 1 + 2 files changed, 3 insertions(+) create mode 100644 src/libs/shouldDelayFocus/index.android.js create mode 100644 src/libs/shouldDelayFocus/index.js diff --git a/src/libs/shouldDelayFocus/index.android.js b/src/libs/shouldDelayFocus/index.android.js new file mode 100644 index 000000000000..e34466d2fbfd --- /dev/null +++ b/src/libs/shouldDelayFocus/index.android.js @@ -0,0 +1,2 @@ +// At android the keyboard doesn't open when we use autoFocus because of page opening transition, so we have to delay the focus. +export default true; diff --git a/src/libs/shouldDelayFocus/index.js b/src/libs/shouldDelayFocus/index.js new file mode 100644 index 000000000000..33136544dba2 --- /dev/null +++ b/src/libs/shouldDelayFocus/index.js @@ -0,0 +1 @@ +export default false; From c64f1c238415c892d05727d7189ab076f144ad7a Mon Sep 17 00:00:00 2001 From: puneet Date: Mon, 7 Nov 2022 19:35:55 -0800 Subject: [PATCH 3/4] import and use shouldDelayFocus --- src/pages/ReimbursementAccount/BankAccountManualStep.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReimbursementAccount/BankAccountManualStep.js b/src/pages/ReimbursementAccount/BankAccountManualStep.js index ef247e3d6b3e..c42b0f7186f4 100644 --- a/src/pages/ReimbursementAccount/BankAccountManualStep.js +++ b/src/pages/ReimbursementAccount/BankAccountManualStep.js @@ -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, @@ -93,7 +94,7 @@ class BankAccountManualStep extends React.Component { /> Date: Wed, 9 Nov 2022 03:14:13 +0530 Subject: [PATCH 4/4] Update comment Co-authored-by: Rushat Gabhane --- src/libs/shouldDelayFocus/index.android.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/shouldDelayFocus/index.android.js b/src/libs/shouldDelayFocus/index.android.js index e34466d2fbfd..4de1e1fc7f3a 100644 --- a/src/libs/shouldDelayFocus/index.android.js +++ b/src/libs/shouldDelayFocus/index.android.js @@ -1,2 +1,2 @@ -// At android the keyboard doesn't open when we use autoFocus because of page opening transition, so we have to delay the focus. +// When using transitions on Android, we need to delay focusing the text inputs for the keyboard to open. export default true;