From 49aefb3f69711ef490c7c457ebb1389cbd9b0edc Mon Sep 17 00:00:00 2001 From: truph01 Date: Tue, 4 Feb 2025 15:01:04 +0700 Subject: [PATCH 1/2] fix: Keyboard overlaps the composer when starting a new thread --- src/pages/home/report/ContextMenu/ContextMenuActions.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index bf5e1b253f3f..f62cbb314b36 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -102,6 +102,7 @@ import type {TranslationPaths} from '@src/languages/types'; import ROUTES from '@src/ROUTES'; import type {Beta, Download as DownloadOnyx, OnyxInputOrEntry, ReportAction, ReportActionReactions, Report as ReportType, Transaction, User} from '@src/types/onyx'; import type IconAsset from '@src/types/utils/IconAsset'; +import KeyboardUtils from '@src/utils/keyboard'; import type {ContextMenuAnchor} from './ReportActionContextMenu'; import {hideContextMenu, showDeleteModal} from './ReportActionContextMenu'; @@ -261,12 +262,9 @@ const ContextMenuActions: ContextMenuAction[] = [ const originalReportID = getOriginalReportID(reportID, reportAction); if (closePopover) { hideContextMenu(false, () => { - InteractionManager.runAfterInteractions(() => { - // Normally the focus callback of the main composer doesn't focus when willBlurTextInputOnTapOutside - // is false, so we need to pass true here to override this condition. - ReportActionComposeFocusManager.focus(true); + KeyboardUtils.dismiss().then(() => { + navigateToAndOpenChildReport(reportAction?.childReportID, reportAction, originalReportID); }); - navigateToAndOpenChildReport(reportAction?.childReportID, reportAction, originalReportID); }); return; } From b455c6a8544cafe12f814545bd397fe1f1ecfd35 Mon Sep 17 00:00:00 2001 From: truph01 Date: Tue, 4 Feb 2025 15:35:44 +0700 Subject: [PATCH 2/2] fix: lint --- src/pages/home/report/ContextMenu/ContextMenuActions.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx index f62cbb314b36..d10d874d2898 100644 --- a/src/pages/home/report/ContextMenu/ContextMenuActions.tsx +++ b/src/pages/home/report/ContextMenu/ContextMenuActions.tsx @@ -1,7 +1,6 @@ import {Str} from 'expensify-common'; import type {MutableRefObject} from 'react'; import React from 'react'; -import {InteractionManager} from 'react-native'; // eslint-disable-next-line no-restricted-imports import type {GestureResponderEvent, Text, View} from 'react-native'; import type {OnyxEntry} from 'react-native-onyx';