Skip to content

Commit

Permalink
fix: delete action is called on canceling the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
parasharrajat committed Jul 4, 2021
1 parent 168d697 commit a015896
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 a015896

Please sign in to comment.