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 committed Nov 25, 2021
1 parent cc0b4b7 commit 73e59a5
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 73e59a5

Please sign in to comment.