@@ -7,6 +7,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
7
7
import ScreenWrapper from '@components/ScreenWrapper' ;
8
8
import Text from '@components/Text' ;
9
9
import TextInput from '@components/TextInput' ;
10
+ import useAutoFocusInput from '@hooks/useAutoFocusInput' ;
10
11
import useLocalize from '@hooks/useLocalize' ;
11
12
import useThemeStyles from '@hooks/useThemeStyles' ;
12
13
import { connectToSageIntacct } from '@libs/actions/connections/SageIntacct' ;
@@ -24,6 +25,7 @@ type SageIntacctPrerequisitesPageProps = PlatformStackScreenProps<SettingsNaviga
24
25
function EnterSageIntacctCredentialsPage ( { route} : SageIntacctPrerequisitesPageProps ) {
25
26
const styles = useThemeStyles ( ) ;
26
27
const { translate} = useLocalize ( ) ;
28
+ const { inputCallbackRef} = useAutoFocusInput ( ) ;
27
29
const policyID : string = route . params . policyID ;
28
30
29
31
const confirmCredentials = useCallback (
@@ -70,14 +72,15 @@ function EnterSageIntacctCredentialsPage({route}: SageIntacctPrerequisitesPagePr
70
72
shouldValidateOnChange
71
73
>
72
74
< Text style = { [ styles . textHeadlineH1 , styles . pb5 , styles . pt3 ] } > { translate ( 'workspace.intacct.enterCredentials' ) } </ Text >
73
- { formItems . map ( ( formItem ) => (
75
+ { formItems . map ( ( formItem , index ) => (
74
76
< View
75
77
style = { styles . mb4 }
76
78
key = { formItem }
77
79
>
78
80
< InputWrapper
79
81
InputComponent = { TextInput }
80
82
inputID = { formItem }
83
+ ref = { index === 0 ? inputCallbackRef : undefined }
81
84
label = { translate ( `common.${ formItem } ` ) }
82
85
aria-label = { translate ( `common.${ formItem } ` ) }
83
86
role = { CONST . ROLE . PRESENTATION }
0 commit comments