From 18c3d1b85603d595a6c04bb43d491108c7dcf11a Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Aug 2018 13:21:59 -0600 Subject: [PATCH 1/2] 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 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 => { From 33236b52698f4815857b3323c83f257cac6b1cab Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Mon, 13 Aug 2018 13:35:39 -0600 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 493928d24e9..22e739a09c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ - Added `disabled` to `EuiRadioGroup.options` ([#1111](https://github.com/elastic/eui/pull/1111)) +**Bug fixes** + +- `EuiWrappingPopover` only re-attach anchor element on unmount if anchor element is still attached to DOM +([#1114](https://github.com/elastic/eui/pull/1114)) + ## [`3.5.1`](https://github.com/elastic/eui/tree/v3.5.1) - Fixed a bug around `indeterminate` checkboxes ([#1110](https://github.com/elastic/eui/pull/1110))