Skip to content

Commit

Permalink
Offset the parent iframe when computing Popover position (#36876)
Browse files Browse the repository at this point in the history
* Offset the parent iframe when computing Popover position even when anchorRefFallback is used

* Update packages/components/src/popover/index.js
  • Loading branch information
adamziel authored and noisysocks committed Nov 29, 2021
1 parent 95a12d6 commit 2976271
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ function computeAnchorRect(
}

const { parentNode } = anchorRefFallback.current;
const rect = parentNode.getBoundingClientRect();
const rect = offsetIframe(
parentNode.getBoundingClientRect(),
parentNode.ownerDocument,
container
);

if ( shouldAnchorIncludePadding ) {
return rect;
Expand Down

0 comments on commit 2976271

Please sign in to comment.