Skip to content

Commit

Permalink
[fixed] check before react-modal removal from parent element that par…
Browse files Browse the repository at this point in the history
…ent has it
  • Loading branch information
Aibol Toleu authored and diasbruno committed Aug 19, 2020
1 parent ff0a7f5 commit fa98fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Modal extends Component {
removePortal = () => {
!isReact16 && ReactDOM.unmountComponentAtNode(this.node);
const parent = getParentElement(this.props.parentSelector);
if (parent) {
if (parent && parent.contains(this.node)) {
parent.removeChild(this.node);
} else {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit fa98fcc

Please sign in to comment.