diff --git a/packages/components/src/popover/index.js b/packages/components/src/popover/index.js index 1742ae16aabfd9..daf53d2139592a 100644 --- a/packages/components/src/popover/index.js +++ b/packages/components/src/popover/index.js @@ -215,6 +215,7 @@ const Popover = ( const arrowRef = useRef( null ); + const [ referenceElement, setReferenceElement ] = useState(); const [ fallbackReferenceElement, setFallbackReferenceElement ] = useState(); const [ referenceOwnerDocument, setReferenceOwnerDocument ] = useState(); @@ -377,6 +378,7 @@ const Popover = ( referenceCallbackRef( resultingReferenceElement ); + setReferenceElement( resultingReferenceElement ); setReferenceOwnerDocument( resultingReferenceOwnerDoc ); }, [ anchor, @@ -500,7 +502,7 @@ const Popover = ( content = { content }; } - if ( anchorRef || anchorRect ) { + if ( referenceElement && referenceElement !== fallbackReferenceElement ) { return content; }