Skip to content

Commit

Permalink
Merge pull request #3882 from parasharrajat/menu-deleted
Browse files Browse the repository at this point in the history
[No QA] fix: delete action is called on canceling the menu
  • Loading branch information
jasperhuangg authored Jul 6, 2021
2 parents 7c34010 + a015896 commit 36a3364
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class ReportActionItem extends Component {
this.confirmDeleteAndHideModal = this.confirmDeleteAndHideModal.bind(this);
this.hideDeleteConfirmModal = this.hideDeleteConfirmModal.bind(this);
this.showDeleteConfirmModal = this.showDeleteConfirmModal.bind(this);
this.contextMenuHide = this.contextMenuHide.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -152,6 +153,13 @@ class ReportActionItem extends Component {
});
}

contextMenuHide() {
this.onPopoverHide();

// After we have called the action, reset it.
this.onPopoverHide = () => {};
}

/**
* This gets called on Dimensions change to find the anchor coordinates for the action context menu.
*/
Expand Down Expand Up @@ -311,7 +319,7 @@ class ReportActionItem extends Component {
<PopoverWithMeasuredContent
isVisible={this.state.isPopoverVisible}
onClose={this.hidePopover}
onModalHide={this.onPopoverHide}
onModalHide={this.contextMenuHide}
anchorPosition={this.state.popoverAnchorPosition}
animationIn="fadeIn"
animationOutTiming={1}
Expand Down

0 comments on commit 36a3364

Please sign in to comment.