Skip to content

Commit c6c3e1e

Browse files
committed
fix: offset height gives invalid px and puts the more options box below the screen
1 parent c06b02b commit c6c3e1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ function RemoteFunctions(config) {
288288
this.body.style.setProperty("left", elemBounds.left + (elemBounds.width - 40) + "px");
289289
this.body.style.setProperty(
290290
"top",
291-
(elemBounds.top - 30 < 0 ? elemBounds.top + elemBounds.offsetHeight + 5 : elemBounds.top - 30) + "px"
291+
// if there's not enough space to show the box above the element,
292+
// we show it below the element
293+
(elemBounds.top - 30 < 0 ? elemBounds.top + elemBounds.height + 5 : elemBounds.top - 30) + "px"
292294
);
293295
this.body.style.setProperty("font-size", "12px");
294296
this.body.style.setProperty("font-family", "Arial, sans-serif");

0 commit comments

Comments
 (0)