Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] fix: delete action is called on canceling the menu #3882

Merged
merged 1 commit into from
Jul 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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