From e38a07cd10ad95fac691335506cf4a032a81181f Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Aug 2018 13:21:59 -0600 Subject: [PATCH] wrapping popover --- src/components/popover/wrapping_popover.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/popover/wrapping_popover.js b/src/components/popover/wrapping_popover.js index 542d779af561..ef94772e8c29 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 => {