From e1f76c02df923b00881a715fec9b56cb0c3feba3 Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Wed, 29 Nov 2023 12:13:39 -0600 Subject: [PATCH 1/2] fix: hide emoji picker for deleted parent action --- src/pages/home/report/ReportActionItem.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index 828a793a8565..7569bacfda68 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -190,6 +190,15 @@ function ReportActionItem(props) { [props.action.reportActionID, reactionListRef], ); + const isDeletedParentAction = ReportActionsUtils.isDeletedParentAction(props.action); + useEffect(() => { + if (!isDeletedParentAction || !EmojiPickerAction.isActive(props.action.reportActionID)) { + return; + } + + EmojiPickerAction.hideEmojiPicker(true); + }, [isDeletedParentAction, props.action.reportActionID]); + useEffect(() => { if (prevDraftMessage || !props.draftMessage) { return; From ac8ac6950c124ab0658dfeea14e511f5595ea76d Mon Sep 17 00:00:00 2001 From: s-alves10 Date: Sun, 3 Dec 2023 13:08:26 -0600 Subject: [PATCH 2/2] fix: add comment --- src/pages/home/report/ReportActionItem.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.js b/src/pages/home/report/ReportActionItem.js index fd824fdf1360..00bdbfacbb61 100644 --- a/src/pages/home/report/ReportActionItem.js +++ b/src/pages/home/report/ReportActionItem.js @@ -153,6 +153,7 @@ function ReportActionItem(props) { const highlightedBackgroundColorIfNeeded = useMemo(() => (isReportActionLinked ? StyleUtils.getBackgroundColorStyle(theme.highlightBG) : {}), [isReportActionLinked, theme]); 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'); @@ -193,8 +194,8 @@ function ReportActionItem(props) { [props.action.reportActionID, reactionListRef], ); - const isDeletedParentAction = ReportActionsUtils.isDeletedParentAction(props.action); useEffect(() => { + // We need to hide EmojiPicker when this is a deleted parent action if (!isDeletedParentAction || !EmojiPickerAction.isActive(props.action.reportActionID)) { return; }