From 1de6f55461a67379784fa700b0832749592a5d7d Mon Sep 17 00:00:00 2001 From: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> Date: Tue, 25 Nov 2025 21:06:15 +1100 Subject: [PATCH] Revert "Fix/73175 - Empty space instead of keyboard if backgrounding app while creating expense" --- src/components/TextInput/index.native.tsx | 6 ++---- tests/perf-test/SelectionList.perf-test.tsx | 1 - tests/ui/BaseTwoFactorAuthFormTest.tsx | 1 - tests/ui/DebugReportActionsTest.tsx | 1 - tests/unit/BaseSelectionListTest.tsx | 1 - 5 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/components/TextInput/index.native.tsx b/src/components/TextInput/index.native.tsx index ff42886d07b6..a2740a8eafb7 100644 --- a/src/components/TextInput/index.native.tsx +++ b/src/components/TextInput/index.native.tsx @@ -1,4 +1,3 @@ -import {useNavigation} from '@react-navigation/native'; import React, {useEffect} from 'react'; import {AppState, Keyboard} from 'react-native'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -7,7 +6,6 @@ import type {BaseTextInputProps} from './BaseTextInput/types'; function TextInput({ref, ...props}: BaseTextInputProps) { const styles = useThemeStyles(); - const navigation = useNavigation(); useEffect(() => { if (!props.disableKeyboard) { @@ -15,7 +13,7 @@ function TextInput({ref, ...props}: BaseTextInputProps) { } const appStateSubscription = AppState.addEventListener('change', (nextAppState) => { - if (!nextAppState.match(/inactive|background/) || !navigation.isFocused()) { + if (!nextAppState.match(/inactive|background/)) { return; } @@ -25,7 +23,7 @@ function TextInput({ref, ...props}: BaseTextInputProps) { return () => { appStateSubscription.remove(); }; - }, [props.disableKeyboard, navigation]); + }, [props.disableKeyboard]); return ( ({ useFocusEffect: () => {}, useIsFocused: () => true, createNavigationContainerRef: jest.fn(), - useNavigation: jest.fn(), })); jest.mock('../../src/hooks/useKeyboardState', () => ({ diff --git a/tests/ui/BaseTwoFactorAuthFormTest.tsx b/tests/ui/BaseTwoFactorAuthFormTest.tsx index 431b697ed268..0560d19eedeb 100644 --- a/tests/ui/BaseTwoFactorAuthFormTest.tsx +++ b/tests/ui/BaseTwoFactorAuthFormTest.tsx @@ -16,7 +16,6 @@ jest.mock('@react-navigation/native', () => { useFocusEffect: (callback: () => void) => { callback(); }, - useNavigation: jest.fn(), }; }); diff --git a/tests/ui/DebugReportActionsTest.tsx b/tests/ui/DebugReportActionsTest.tsx index 66dc8665c3d9..a72df0a538ec 100644 --- a/tests/ui/DebugReportActionsTest.tsx +++ b/tests/ui/DebugReportActionsTest.tsx @@ -18,7 +18,6 @@ jest.mock('@react-navigation/native', () => { ...actualNav, useIsFocused: () => true, useFocusEffect: jest.fn(), - useNavigation: jest.fn(), }; }); diff --git a/tests/unit/BaseSelectionListTest.tsx b/tests/unit/BaseSelectionListTest.tsx index 29938c54282c..f4e5ec51fcbd 100644 --- a/tests/unit/BaseSelectionListTest.tsx +++ b/tests/unit/BaseSelectionListTest.tsx @@ -26,7 +26,6 @@ jest.mock('@react-navigation/native', () => { ...actualNav, useIsFocused: jest.fn(), useFocusEffect: jest.fn(), - useNavigation: jest.fn(), }; });