Skip to content

Commit

Permalink
Merge pull request #47718 from Expensify/revert-47486-fix/45524-messa…
Browse files Browse the repository at this point in the history
…ge-highlight-is-stukck

[CP Staging] Revert "Fix message highlight stuck when open the 2nd context menu"
  • Loading branch information
luacmartins authored Aug 20, 2024
2 parents ef5310c + b73603a commit 5229654
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ function PopoverReportActionContextMenu(_props: unknown, ref: ForwardedRef<Repor
reportIDRef.current = '-1';
reportActionIDRef.current = '-1';
originalReportIDRef.current = '-1';
setInstanceID('');

onPopoverHide.current = runAndResetCallback(onPopoverHide.current);
onPopoverHideActionCallback.current = runAndResetCallback(onPopoverHideActionCallback.current);
Expand Down
48 changes: 22 additions & 26 deletions src/pages/home/report/ContextMenu/ReportActionContextMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,37 +123,33 @@ function showContextMenu(
if (!contextMenuRef.current) {
return;
}
const show = () => {
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,
);
}

/**
Expand Down

0 comments on commit 5229654

Please sign in to comment.