Skip to content

Commit 5229654

Browse files
authored
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"
2 parents ef5310c + b73603a commit 5229654

File tree

2 files changed

+22
-27
lines changed

2 files changed

+22
-27
lines changed

src/pages/home/report/ContextMenu/PopoverReportActionContextMenu.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
242242
reportIDRef.current = '-1';
243243
reportActionIDRef.current = '-1';
244244
originalReportIDRef.current = '-1';
245-
setInstanceID('');
246245

247246
onPopoverHide.current = runAndResetCallback(onPopoverHide.current);
248247
onPopoverHideActionCallback.current = runAndResetCallback(onPopoverHideActionCallback.current);

src/pages/home/report/ContextMenu/ReportActionContextMenu.ts

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -123,37 +123,33 @@ function showContextMenu(
123123
if (!contextMenuRef.current) {
124124
return;
125125
}
126-
const show = () => {
127-
contextMenuRef.current?.showContextMenu(
128-
type,
129-
event,
130-
selection,
131-
contextMenuAnchor,
132-
reportID,
133-
reportActionID,
134-
originalReportID,
135-
draftMessage,
136-
onShow,
137-
onHide,
138-
isArchivedRoom,
139-
isChronosReport,
140-
isPinnedChat,
141-
isUnreadChat,
142-
disabledActions,
143-
shouldCloseOnTarget,
144-
setIsEmojiPickerActive,
145-
isOverflowMenu,
146-
);
147-
};
148-
149126
// If there is an already open context menu, close it first before opening
150127
// a new one.
151128
if (contextMenuRef.current.instanceID) {
152-
hideContextMenu(false, show);
153-
return;
129+
hideContextMenu();
130+
contextMenuRef.current.runAndResetOnPopoverHide();
154131
}
155132

156-
show();
133+
contextMenuRef.current.showContextMenu(
134+
type,
135+
event,
136+
selection,
137+
contextMenuAnchor,
138+
reportID,
139+
reportActionID,
140+
originalReportID,
141+
draftMessage,
142+
onShow,
143+
onHide,
144+
isArchivedRoom,
145+
isChronosReport,
146+
isPinnedChat,
147+
isUnreadChat,
148+
disabledActions,
149+
shouldCloseOnTarget,
150+
setIsEmojiPickerActive,
151+
isOverflowMenu,
152+
);
157153
}
158154

159155
/**

0 commit comments

Comments
 (0)