Skip to content

Commit fa98fcc

Browse files
Aibol Toleudiasbruno
Aibol Toleu
authored andcommittedAug 19, 2020
[fixed] check before react-modal removal from parent element that parent has it
1 parent ff0a7f5 commit fa98fcc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎src/components/Modal.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class Modal extends Component {
176176
removePortal = () => {
177177
!isReact16 && ReactDOM.unmountComponentAtNode(this.node);
178178
const parent = getParentElement(this.props.parentSelector);
179-
if (parent) {
179+
if (parent && parent.contains(this.node)) {
180180
parent.removeChild(this.node);
181181
} else {
182182
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)
Please sign in to comment.