Skip to content

Commit 2577a9f

Browse files
committed
fix: use screenOffset to calculate overflow
1 parent e8bc9c6 commit 2577a9f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ function RemoteFunctions(config) {
687687
if (_nodeMoreOptionsBox && _nodeMoreOptionsBox._shadow) {
688688
const moreOptionsBoxElement = _nodeMoreOptionsBox._shadow.querySelector('.phoenix-more-options-box');
689689
if (moreOptionsBoxElement) {
690+
const moreOptionsBoxOffset = _screenOffset(moreOptionsBoxElement);
690691
const moreOptionsBoxRect = moreOptionsBoxElement.getBoundingClientRect();
691692

692693
const infoBox = {
@@ -697,16 +698,18 @@ function RemoteFunctions(config) {
697698
};
698699

699700
const moreOptionsBox = {
700-
left: moreOptionsBoxRect.left,
701-
top: moreOptionsBoxRect.top,
702-
right: moreOptionsBoxRect.right,
703-
bottom: moreOptionsBoxRect.bottom
701+
left: moreOptionsBoxOffset.left,
702+
top: moreOptionsBoxOffset.top,
703+
right: moreOptionsBoxOffset.left + moreOptionsBoxRect.width,
704+
bottom: moreOptionsBoxOffset.top + moreOptionsBoxRect.height
704705
};
705706

706-
return !(infoBox.right < moreOptionsBox.left ||
707+
const isOverlapping = !(infoBox.right < moreOptionsBox.left ||
707708
moreOptionsBox.right < infoBox.left ||
708709
infoBox.bottom < moreOptionsBox.top ||
709710
moreOptionsBox.bottom < infoBox.top);
711+
712+
return isOverlapping;
710713
}
711714
}
712715
return false;

0 commit comments

Comments
 (0)