From b73603a549b967338263aa4b95846e4b186f7f89 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 20 Aug 2024 10:33:29 -0400 Subject: [PATCH] Revert "Fix message highlight stuck when open the 2nd context menu" --- .../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, + ); } /**