From 3090fe62fec53aceade412dc3cd33a3f2158548c Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Sat, 6 Jun 2026 00:40:35 -0400 Subject: [PATCH] fix: Forge iframe height uses 82vh (bypasses flex parent issue) height:100% doesn't work when parent uses flex height. position:absolute collapses the parent. 82vh = 90vh modal - header. Also set bodyEl overflow:hidden. --- frontend/app.js | 2 +- frontend/js/viewer.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 74fa0a4..736451b 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -3302,7 +3302,7 @@ var iframe = document.createElement("iframe"); iframe.id = "forge-iframe"; iframe.src = "/editor-poc?vault=" + encodeURIComponent(data.vault) + "&path=" + encodeURIComponent(data.path); - iframe.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;border:none;"; + iframe.style.cssText = "width:100%;height:82vh;border:none;display:block;"; bodyEl.appendChild(iframe); modal.classList.add("active"); safeCreateIcons(); diff --git a/frontend/js/viewer.js b/frontend/js/viewer.js index 5c906b1..10995a3 100644 --- a/frontend/js/viewer.js +++ b/frontend/js/viewer.js @@ -504,10 +504,11 @@ export function renderFile(data) { var bodyEl = document.getElementById("editor-body"); titleEl.textContent = "Forge: " + data.path.split("/").pop(); bodyEl.innerHTML = ""; + bodyEl.style.overflow = "hidden"; var iframe = document.createElement("iframe"); iframe.id = "forge-iframe"; iframe.src = "/editor-poc?vault=" + encodeURIComponent(data.vault) + "&path=" + encodeURIComponent(data.path); - iframe.style.cssText = "position:absolute;top:0;left:0;width:100%;height:100%;border:none;"; + iframe.style.cssText = "width:100%;height:82vh;border:none;display:block;"; bodyEl.appendChild(iframe); modal.classList.add("active"); safeCreateIcons();