From f576235d3e0f7fb340dba1732164c55050919964 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 20 Aug 2024 14:53:44 -0400 Subject: [PATCH] Merge pull request #47718 from Expensify/revert-47486-fix/45524-message-highlight-is-stukck [CP Staging] Revert "Fix message highlight stuck when open the 2nd context menu" (cherry picked from commit 52296549e0e373a0f69ce98dff5e129ecf80c19e) (CP triggered by luacmartins) --- .../PopoverReportActionContextMenu.tsx | 1 - .../ContextMenu/ReportActionContextMenu.ts | 48 +++++++++---------- 2 files changed, 22 insertions(+), 27 deletions(-) diff --git a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx index 50b424fc736b..5cfce625201e 100644 --- a/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx +++ b/src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx @@ -242,7 +242,6 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef { - contextMenuRef.current?.showContextMenu( - type, - event, - selection, - contextMenuAnchor, - reportID, - reportActionID, - originalReportID, - draftMessage, - onShow, - onHide, - isArchivedRoom, - isChronosReport, - isPinnedChat, - isUnreadChat, - disabledActions, - shouldCloseOnTarget, - setIsEmojiPickerActive, - isOverflowMenu, - ); - }; - // If there is an already open context menu, close it first before opening // a new one. if (contextMenuRef.current.instanceID) { - hideContextMenu(false, show); - return; + hideContextMenu(); + contextMenuRef.current.runAndResetOnPopoverHide(); } - show(); + contextMenuRef.current.showContextMenu( + type, + event, + selection, + contextMenuAnchor, + reportID, + reportActionID, + originalReportID, + draftMessage, + onShow, + onHide, + isArchivedRoom, + isChronosReport, + isPinnedChat, + isUnreadChat, + disabledActions, + shouldCloseOnTarget, + setIsEmojiPickerActive, + isOverflowMenu, + ); } /**