From 12ef5e0570ef2f98f792b7fe690e6b0dfeac13b4 Mon Sep 17 00:00:00 2001 From: Roman Axelrod Date: Sat, 22 Oct 2022 13:25:37 +0300 Subject: [PATCH] Update resizing logic, listen to
tag changes and not . --- layouts/scripts/frame-index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/layouts/scripts/frame-index.js b/layouts/scripts/frame-index.js index c75cb14..79bb1a1 100644 --- a/layouts/scripts/frame-index.js +++ b/layouts/scripts/frame-index.js @@ -8,10 +8,8 @@ function setupResizeListener() { const RESIZE_CODE = 'resize:'; const resizeObserver = new ResizeObserver(entries => { - setTimeout(() => { - const height = document.body.scrollHeight; - window.parent.postMessage(RESIZE_CODE + JSON.stringify({height}), '*'); - }, 200); + const height = document.querySelector('body > main').scrollHeight; + window.parent.postMessage(RESIZE_CODE + JSON.stringify({height}), '*'); }) resizeObserver.observe(document.body);