Skip to content

Commit

Permalink
Merge pull request #37955 from Krishna2323/krishna2323/issue/36948
Browse files Browse the repository at this point in the history
fix: Hold Request - Keyboard is up but the field is not focused with error message showing
  • Loading branch information
robertjchen authored Mar 22, 2024
2 parents edfb3b1 + 0c588d6 commit 4e6c52c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/iou/HoldReasonPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
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 * as ErrorUtils from '@libs/ErrorUtils';
Expand Down Expand Up @@ -40,6 +41,7 @@ type HoldReasonPageProps = {
function HoldReasonPage({route}: HoldReasonPageProps) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const {inputCallbackRef} = useAutoFocusInput();

const {transactionID, reportID, backTo} = route.params;

Expand Down Expand Up @@ -110,7 +112,7 @@ function HoldReasonPage({route}: HoldReasonPageProps) {
defaultValue={undefined}
label={translate('iou.reason')}
accessibilityLabel={translate('iou.reason')}
autoFocus
ref={inputCallbackRef}
/>
</View>
</FormProvider>
Expand Down
3 changes: 3 additions & 0 deletions src/pages/settings/ExitSurvey/ExitSurveyResponsePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {AnimatedTextInputRef} from '@components/RNTextInput';
import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
import useAutoFocusInput from '@hooks/useAutoFocusInput';
import useKeyboardShortcut from '@hooks/useKeyboardShortcut';
import useKeyboardState from '@hooks/useKeyboardState';
import useLocalize from '@hooks/useLocalize';
Expand Down Expand Up @@ -43,6 +44,7 @@ function ExitSurveyResponsePage({draftResponse, route, navigation}: ExitSurveyRe
const {keyboardHeight} = useKeyboardState();
const {windowHeight} = useWindowDimensions();
const {top: safeAreaInsetsTop} = useSafeAreaInsets();
const {inputCallbackRef} = useAutoFocusInput();

const {reason, backTo} = route.params;
const {isOffline} = useNetwork({
Expand Down Expand Up @@ -132,6 +134,7 @@ function ExitSurveyResponsePage({draftResponse, route, navigation}: ExitSurveyRe
return;
}
updateMultilineInputRange(el);
inputCallbackRef(el);
}}
containerStyles={[baseResponseInputContainerStyle, StyleUtils.getMaximumHeight(responseInputMaxHeight)]}
shouldSaveDraft
Expand Down

0 comments on commit 4e6c52c

Please sign in to comment.