MainHeader: Ensure unmount doesn't double-remove on popperRoot
This commit is contained in:
parent
c5ea29d1f1
commit
3aff3ed181
1 changed files with 2 additions and 2 deletions
|
@ -127,7 +127,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
||||||
popperRoot: null,
|
popperRoot: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (popperRoot) {
|
if (popperRoot && document.body.contains(popperRoot)) {
|
||||||
document.body.removeChild(popperRoot);
|
document.body.removeChild(popperRoot);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -138,7 +138,7 @@ export class MainHeader extends React.Component<PropsType, StateType> {
|
||||||
document.removeEventListener('click', this.handleOutsideClick);
|
document.removeEventListener('click', this.handleOutsideClick);
|
||||||
document.removeEventListener('keydown', this.handleOutsideKeyDown);
|
document.removeEventListener('keydown', this.handleOutsideKeyDown);
|
||||||
|
|
||||||
if (popperRoot) {
|
if (popperRoot && document.body.contains(popperRoot)) {
|
||||||
document.body.removeChild(popperRoot);
|
document.body.removeChild(popperRoot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue