Skip to content

Commit

Permalink
fix enter key for got it button
Browse files Browse the repository at this point in the history
  • Loading branch information
dukenv0307 committed Aug 22, 2024
1 parent ad7c1d5 commit bb3edec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CONFIG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ export default {
IOS_CLIENT_ID: '921154746561-s3uqn2oe4m85tufi6mqflbfbuajrm2i3.apps.googleusercontent.com',
},
GCP_GEOLOCATION_API_KEY: googleGeolocationAPIKey,
USE_REACT_STRICT_MODE: true,
USE_REACT_STRICT_MODE: false,
} as const;
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 bb3edec

Please sign in to comment.