Skip to content

Commit

Permalink
Merge pull request #19744 from kidroca/kidroca/fix/base-modal-oversight
Browse files Browse the repository at this point in the history
Fix bug in global modal state management during unmounting
  • Loading branch information
Hayata Suenaga authored Jun 6, 2023
2 parents 8ac1e94 + 1e99974 commit 08b1bf6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/Modal/BaseModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ class BaseModal extends PureComponent {
}

componentWillUnmount() {
// we don't want to call the onModalHide on unmount
this.hideModal(this.props.isVisible);

// Only trigger onClose and setModalVisibility if the modal is unmounting while visible.
if (this.props.isVisible) {
this.hideModal(true);
Modal.willAlertModalBecomeVisible(false);
}

Expand Down

0 comments on commit 08b1bf6

Please sign in to comment.