Skip to content

Commit

Permalink
Merge pull request #40130 from GandalfGwaihir/issue39845
Browse files Browse the repository at this point in the history
[Fix]: Report fields are not auto focused on field selection
  • Loading branch information
marcochavezf authored Apr 16, 2024
2 parents ab8c6d3 + d577868 commit 2db0758
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/EditReportFieldText.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, {useCallback, useRef} from 'react';
import React, {useCallback} from 'react';
import {View} from 'react-native';
import FormProvider from '@components/Form/FormProvider';
import InputWrapper from '@components/Form/InputWrapper';
import type {FormInputErrors, FormOnyxValues} from '@components/Form/types';
import type {AnimatedTextInputRef} from '@components/RNTextInput';
import TextInput from '@components/TextInput';
import useAutoFocusInput from '@hooks/useAutoFocusInput';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import CONST from '@src/CONST';
Expand All @@ -30,7 +30,7 @@ type EditReportFieldTextPageProps = {
function EditReportFieldTextPage({fieldName, onSubmit, fieldValue, isRequired, fieldKey}: EditReportFieldTextPageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const inputRef = useRef<AnimatedTextInputRef>(null);
const {inputCallbackRef} = useAutoFocusInput();

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.REPORT_FIELD_EDIT_FORM>) => {
Expand Down Expand Up @@ -61,7 +61,7 @@ function EditReportFieldTextPage({fieldName, onSubmit, fieldValue, isRequired, f
label={fieldName}
accessibilityLabel={fieldName}
role={CONST.ROLE.PRESENTATION}
ref={inputRef}
ref={inputCallbackRef}
/>
</View>
</FormProvider>
Expand Down

0 comments on commit 2db0758

Please sign in to comment.