Skip to content

Commit

Permalink
Merge pull request #32209 from s-alves10/fix/issue-31727
Browse files Browse the repository at this point in the history
fix: hide emoji picker for deleted parent action
  • Loading branch information
srikarparsi authored Dec 11, 2023
2 parents 320dc96 + a03448f commit 4f41819
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function ReportActionItem(props) {
[StyleUtils, isReportActionLinked, theme.highlightBG],
);
const originalMessage = lodashGet(props.action, 'originalMessage', {});
const isDeletedParentAction = ReportActionsUtils.isDeletedParentAction(props.action);

// IOUDetails only exists when we are sending money
const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails');
Expand Down Expand Up @@ -197,6 +198,15 @@ function ReportActionItem(props) {
[props.action.reportActionID, reactionListRef],
);

useEffect(() => {
// We need to hide EmojiPicker when this is a deleted parent action
if (!isDeletedParentAction || !EmojiPickerAction.isActive(props.action.reportActionID)) {
return;
}

EmojiPickerAction.hideEmojiPicker(true);
}, [isDeletedParentAction, props.action.reportActionID]);

useEffect(() => {
if (prevDraftMessage || !props.draftMessage) {
return;
Expand Down

0 comments on commit 4f41819

Please sign in to comment.