diff --git a/src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/substeps/NetSuiteTokenInputForm.tsx b/src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/substeps/NetSuiteTokenInputForm.tsx index 3747bf1b6e4e..580ad181e6ed 100644 --- a/src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/substeps/NetSuiteTokenInputForm.tsx +++ b/src/pages/workspace/accounting/netsuite/NetSuiteTokenInput/substeps/NetSuiteTokenInputForm.tsx @@ -6,6 +6,7 @@ import type {FormInputErrors, FormOnyxValues} from '@components/Form/types'; import RenderHTML from '@components/RenderHTML'; import Text from '@components/Text'; import TextInput from '@components/TextInput'; +import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useLocalize from '@hooks/useLocalize'; import type {SubStepProps} from '@hooks/useSubStep/types'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -19,6 +20,7 @@ import INPUT_IDS from '@src/types/form/NetSuiteTokenInputForm'; function NetSuiteTokenInputForm({onNext, policyID}: SubStepProps & {policyID: string}) { const styles = useThemeStyles(); const {translate} = useLocalize(); + const {inputCallbackRef} = useAutoFocusInput(); const formInputs = Object.values(INPUT_IDS); @@ -58,7 +60,7 @@ function NetSuiteTokenInputForm({onNext, policyID}: SubStepProps & {policyID: st shouldValidateOnBlur shouldValidateOnChange > - {formInputs.map((formInput) => ( + {formInputs.map((formInput, index) => ( config?.syncOptions?.[importCustomField] ?? [], [config?.syncOptions, importCustomField]); @@ -123,10 +125,11 @@ function NetSuiteImportCustomFieldEdit({ role={CONST.ROLE.PRESENTATION} spellCheck={false} defaultValue={fieldValue ?? ''} + ref={inputCallbackRef} /> ), - [config?.syncOptions?.pendingFields, customField, fieldName, fieldValue, importCustomField, styles.flexGrow1, styles.ph5, translate, updateRecord, validate], + [config?.syncOptions?.pendingFields, customField, fieldName, fieldValue, importCustomField, inputCallbackRef, styles.flexGrow1, styles.ph5, translate, updateRecord, validate], ); const renderSelection = useMemo( diff --git a/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/substeps/CustomSegmentInternalIdStep.tsx b/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/substeps/CustomSegmentInternalIdStep.tsx index 366936138d42..df110dfb1eeb 100644 --- a/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/substeps/CustomSegmentInternalIdStep.tsx +++ b/src/pages/workspace/accounting/netsuite/import/NetSuiteImportCustomFieldNew/substeps/CustomSegmentInternalIdStep.tsx @@ -4,6 +4,7 @@ import InputWrapper from '@components/Form/InputWrapper'; import RenderHTML from '@components/RenderHTML'; import Text from '@components/Text'; import TextInput from '@components/TextInput'; +import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import Parser from '@libs/Parser'; @@ -14,6 +15,8 @@ import INPUT_IDS from '@src/types/form/NetSuiteCustomFieldForm'; function CustomSegmentInternalIdStep({customSegmentType}: CustomFieldSubStepWithPolicy) { const styles = useThemeStyles(); const {translate} = useLocalize(); + const {inputCallbackRef} = useAutoFocusInput(); + const customSegmentRecordType = customSegmentType ?? CONST.NETSUITE_CUSTOM_RECORD_TYPES.CUSTOM_SEGMENT; const fieldLabel = translate(`workspace.netsuite.import.importCustomFields.customSegments.fields.internalID`); @@ -30,6 +33,7 @@ function CustomSegmentInternalIdStep({customSegmentType}: CustomFieldSubStepWith aria-label={fieldLabel} role={CONST.ROLE.PRESENTATION} spellCheck={false} + ref={inputCallbackRef} /> ${Parser.replace(translate(`workspace.netsuite.import.importCustomFields.customLists.addForm.transactionFieldIDFooter`))}`} />