diff --git a/src/hooks/useRestoreInputFocus.ts b/src/hooks/useRestoreInputFocus.ts deleted file mode 100644 index a8049eb70b77..000000000000 --- a/src/hooks/useRestoreInputFocus.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {useEffect, useRef} from 'react'; -import {InteractionManager, Keyboard} from 'react-native'; -import {KeyboardController} from 'react-native-keyboard-controller'; - -const useRestoreInputFocus = (isLostFocus: boolean) => { - const keyboardVisibleBeforeLoosingFocusRef = useRef(false); - - useEffect(() => { - if (isLostFocus) { - keyboardVisibleBeforeLoosingFocusRef.current = Keyboard.isVisible(); - } - - if (!isLostFocus && keyboardVisibleBeforeLoosingFocusRef.current) { - InteractionManager.runAfterInteractions(() => { - KeyboardController.setFocusTo('current'); - }); - } - }, [isLostFocus]); -}; - -export default useRestoreInputFocus; diff --git a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx index b88a5a0bd33e..1d7deea43a04 100755 --- a/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx @@ -16,7 +16,6 @@ import useLocalize from '@hooks/useLocalize'; import useNetwork from '@hooks/useNetwork'; import usePaginatedReportActions from '@hooks/usePaginatedReportActions'; import useResponsiveLayout from '@hooks/useResponsiveLayout'; -import useRestoreInputFocus from '@hooks/useRestoreInputFocus'; import useStyleUtils from '@hooks/useStyleUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; @@ -269,7 +268,6 @@ function BaseReportActionContextMenu({ }, {isActive: shouldEnableArrowNavigation && shouldEnableContextMenuEnterShortcut, shouldPreventDefault: false}, ); - useRestoreInputFocus(isVisible); const openOverflowMenu = (event: GestureResponderEvent | MouseEvent, anchorRef: MutableRefObject) => { showContextMenu(