Skip to content

Commit

Permalink
Merge pull request #32893 from bernhardoj/fix/28029-hovered-bg-color-…
Browse files Browse the repository at this point in the history
…stuck

Fix hovered background color is stuck after canceling the message delete modal
  • Loading branch information
blimpich authored Dec 28, 2023
2 parents 75597c4 + f34f451 commit c56d781
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as Download from '@userActions/Download';
import * as Report from '@userActions/Report';
import CONST from '@src/CONST';
import ROUTES from '@src/ROUTES';
import {clearActiveReportAction, hideContextMenu, showDeleteModal} from './ReportActionContextMenu';
import {hideContextMenu, showDeleteModal} from './ReportActionContextMenu';

/**
* Gets the HTML version of the message in an action.
Expand Down Expand Up @@ -417,12 +417,12 @@ export default [
onPress: (closePopover, {reportID, reportAction}) => {
if (closePopover) {
// Hide popover, then call showDeleteConfirmModal
hideContextMenu(false, () => showDeleteModal(reportID, reportAction, true, clearActiveReportAction, clearActiveReportAction));
hideContextMenu(false, () => showDeleteModal(reportID, reportAction));
return;
}

// No popover to hide, call showDeleteConfirmModal immediately
showDeleteModal(reportID, reportAction, true, clearActiveReportAction, clearActiveReportAction);
showDeleteModal(reportID, reportAction);
},
getDescription: () => {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ function PopoverReportActionContextMenu(_props, ref) {
onConfirm={confirmDeleteAndHideModal}
onCancel={hideDeleteModal}
onModalHide={() => {
clearActiveReportAction();
callbackWhenDeleteModalHide.current();
}}
prompt={translate('reportActionContextMenu.deleteConfirmation', {action: reportAction})}
Expand Down
6 changes: 0 additions & 6 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,6 @@ function ReportActionItem(props) {
// IOUDetails only exists when we are sending money
const isSendingMoney = originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY && _.has(originalMessage, 'IOUDetails');

// When active action changes, we need to update the `isContextMenuActive` state
const isActiveReportActionForMenu = ReportActionContextMenu.isActiveReportAction(props.action.reportActionID);
useEffect(() => {
setIsContextMenuActive(isActiveReportActionForMenu);
}, [isActiveReportActionForMenu]);

const updateHiddenState = useCallback(
(isHiddenValue) => {
setIsHidden(isHiddenValue);
Expand Down

0 comments on commit c56d781

Please sign in to comment.