Skip to content

Commit

Permalink
Merge pull request Expensify#47833 from dukenv0307/fix/36825
Browse files Browse the repository at this point in the history
fix enter key for got it button
  • Loading branch information
robertjchen authored Aug 27, 2024
2 parents af98a53 + f975dcb commit 5a29fc1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/pages/ProcessMoneyRequestHoldPage.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import React, {useCallback, useMemo} from 'react';
import {View} from 'react-native';
import {useFocusEffect} from '@react-navigation/native';
import React, {useCallback, useMemo, useRef} from 'react';
import {InteractionManager, View} from 'react-native';
import Button from '@components/Button';
import HeaderPageLayout from '@components/HeaderPageLayout';
import HoldMenuSectionList from '@components/HoldMenuSectionList';
import Text from '@components/Text';
import TextPill from '@components/TextPill';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
import blurActiveElement from '@libs/Accessibility/blurActiveElement';
import Navigation from '@libs/Navigation/Navigation';
import * as IOU from '@userActions/IOU';
import CONST from '@src/CONST';

function ProcessMoneyRequestHoldPage() {
const styles = useThemeStyles();
const {translate} = useLocalize();

const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);
useFocusEffect(
useCallback(() => {
focusTimeoutRef.current = setTimeout(() => {
InteractionManager.runAfterInteractions(() => {
blurActiveElement();
});
}, CONST.ANIMATED_TRANSITION);
return () => focusTimeoutRef.current && clearTimeout(focusTimeoutRef.current);
}, []),
);

const onConfirm = useCallback(() => {
IOU.dismissHoldUseExplanation();
Navigation.goBack();
Expand All @@ -26,6 +41,7 @@ function ProcessMoneyRequestHoldPage() {
text={translate('common.buttonConfirm')}
onPress={onConfirm}
large
pressOnEnter
/>
),
[onConfirm, translate],
Expand Down

0 comments on commit 5a29fc1

Please sign in to comment.