diff --git a/src/modules/Popup/Popup.js b/src/modules/Popup/Popup.js index 49a0e638f5..cdeea7173d 100644 --- a/src/modules/Popup/Popup.js +++ b/src/modules/Popup/Popup.js @@ -271,8 +271,13 @@ export default class Popup extends Component { debug('popper modifiers:', modifiers) const referenceElement = createReferenceProxy(_.isNil(context) ? this.triggerRef : context) + // make sure we mount the Popup to the relevant document.body in case of a new window created with window.open() + const mountNodeProp = + referenceElement.ref && referenceElement.ref.current + ? { mountNode: referenceElement.ref.current.ownerDocument.body } + : {} - const mergedPortalProps = { ...this.getPortalProps(), ...portalRestProps } + const mergedPortalProps = { ...this.getPortalProps(), ...portalRestProps, ...mountNodeProp } debug('portal props:', mergedPortalProps) return (