diff --git a/src/components/popover/wrapping_popover.js b/src/components/popover/wrapping_popover.js index 542d779af56..ef94772e8c2 100644 --- a/src/components/popover/wrapping_popover.js +++ b/src/components/popover/wrapping_popover.js @@ -28,10 +28,12 @@ export class EuiWrappingPopover extends Component { } componentWillUnmount() { - this.portal.insertAdjacentElement( - 'beforebegin', - this.props.button - ); + if (this.props.button.parentNode) { + this.portal.insertAdjacentElement( + 'beforebegin', + this.props.button + ); + } } setPortalRef = node => {