From 12070943bc55b4627f0831f3480bba54b7bdb6fe Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Aug 2024 14:34:37 +0800 Subject: [PATCH 1/4] fix composer not focused when pressing key --- src/components/FocusTrap/FocusTrapForScreen/index.web.tsx | 5 +++++ src/pages/workspace/WorkspaceProfileSharePage.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx b/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx index cd8dc3ddaa0a..350c3f3bfa9a 100644 --- a/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx +++ b/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx @@ -8,6 +8,7 @@ import WIDE_LAYOUT_INACTIVE_SCREENS from '@components/FocusTrap/WIDE_LAYOUT_INAC import useWindowDimensions from '@hooks/useWindowDimensions'; import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus'; import CONST from '@src/CONST'; +import NAVIGATORS from '@src/NAVIGATORS'; import type FocusTrapProps from './FocusTrapProps'; function FocusTrapForScreen({children}: FocusTrapProps) { @@ -26,6 +27,10 @@ function FocusTrapForScreen({children}: FocusTrapProps) { return isFocused; } + if (route.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) { + return isFocused; + } + // Focus trap can't be active on these screens if the layout is wide because they may be displayed side by side. if (WIDE_LAYOUT_INACTIVE_SCREENS.includes(route.name) && !isSmallScreenWidth) { return false; diff --git a/src/pages/workspace/WorkspaceProfileSharePage.tsx b/src/pages/workspace/WorkspaceProfileSharePage.tsx index 16a076205ad3..58c4564cc842 100644 --- a/src/pages/workspace/WorkspaceProfileSharePage.tsx +++ b/src/pages/workspace/WorkspaceProfileSharePage.tsx @@ -86,7 +86,7 @@ function WorkspaceProfileSharePage({policy}: WithPolicyProps) { if (!adminRoom?.reportID) { return; } - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(adminRoom.reportID)); + Navigation.dismissModal(adminRoom.reportID); }} > {CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS} From 41f006eb7e95480d22702e781a5704e921b08cae Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Aug 2024 22:35:25 +0800 Subject: [PATCH 2/4] use navigate back --- src/pages/workspace/WorkspaceProfileSharePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/workspace/WorkspaceProfileSharePage.tsx b/src/pages/workspace/WorkspaceProfileSharePage.tsx index 58c4564cc842..16a076205ad3 100644 --- a/src/pages/workspace/WorkspaceProfileSharePage.tsx +++ b/src/pages/workspace/WorkspaceProfileSharePage.tsx @@ -86,7 +86,7 @@ function WorkspaceProfileSharePage({policy}: WithPolicyProps) { if (!adminRoom?.reportID) { return; } - Navigation.dismissModal(adminRoom.reportID); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(adminRoom.reportID)); }} > {CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS} From fbcfdb782e13e1e499312815ecaa58425e27c270 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Aug 2024 22:35:35 +0800 Subject: [PATCH 3/4] set the modal visibility when blurred --- src/libs/Navigation/AppNavigator/AuthScreens.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index e3ba198f0e30..77b8467a8c58 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -182,6 +182,9 @@ const modalScreenListeners = { focus: () => { Modal.setModalVisibility(true); }, + blur: () => { + Modal.setModalVisibility(false); + }, beforeRemove: () => { // Clear search input (WorkspaceInvitePage) when modal is closed SearchInputManager.searchInput = ''; From 4f37bc70db1809d299907ecbbd53c693c43daf7b Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Aug 2024 23:53:35 +0800 Subject: [PATCH 4/4] remove unused logic --- src/components/FocusTrap/FocusTrapForScreen/index.web.tsx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx b/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx index 350c3f3bfa9a..cd8dc3ddaa0a 100644 --- a/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx +++ b/src/components/FocusTrap/FocusTrapForScreen/index.web.tsx @@ -8,7 +8,6 @@ import WIDE_LAYOUT_INACTIVE_SCREENS from '@components/FocusTrap/WIDE_LAYOUT_INAC import useWindowDimensions from '@hooks/useWindowDimensions'; import canFocusInputOnScreenFocus from '@libs/canFocusInputOnScreenFocus'; import CONST from '@src/CONST'; -import NAVIGATORS from '@src/NAVIGATORS'; import type FocusTrapProps from './FocusTrapProps'; function FocusTrapForScreen({children}: FocusTrapProps) { @@ -27,10 +26,6 @@ function FocusTrapForScreen({children}: FocusTrapProps) { return isFocused; } - if (route.name === NAVIGATORS.FULL_SCREEN_NAVIGATOR) { - return isFocused; - } - // Focus trap can't be active on these screens if the layout is wide because they may be displayed side by side. if (WIDE_LAYOUT_INACTIVE_SCREENS.includes(route.name) && !isSmallScreenWidth) { return false;