Skip to content

Commit 210c2e6

Browse files
committed
fix: also add left side check overflow for the label
1 parent 3fdf721 commit 210c2e6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,11 @@ function RemoteFunctions(config = {}) {
10121012
// if right side overflows, we switch to the left side
10131013
if (labelLeft + labelRect.width > window.innerWidth) {
10141014
labelLeft = arrowRect.left - labelRect.width - 10;
1015+
1016+
// if left side also overflows then we switch back to the right side
1017+
if (labelLeft < 0) {
1018+
labelLeft = arrowRect.right + 7.5;
1019+
}
10151020
}
10161021

10171022
label.style.left = labelLeft + 'px';

0 commit comments

Comments
 (0)