From b5a668a2fdd41cbafe7c44fd83369289783a7e7b Mon Sep 17 00:00:00 2001 From: Jesse Baker <jesse.baker@acquia.com> Date: Fri, 11 Apr 2025 10:13:28 +0100 Subject: [PATCH] Fix for inline vh units of elements in the preview to be converted to static height based on height of iframe --- ui/src/hooks/useSyncIframeHeightToContent.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ui/src/hooks/useSyncIframeHeightToContent.ts b/ui/src/hooks/useSyncIframeHeightToContent.ts index ee375bce5e..d7680cf046 100644 --- a/ui/src/hooks/useSyncIframeHeightToContent.ts +++ b/ui/src/hooks/useSyncIframeHeightToContent.ts @@ -62,10 +62,7 @@ function useSyncIframeHeightToContent( const elements: NodeListOf<HTMLElement> = iframeHTML.querySelectorAll('*'); elements.forEach((element) => { - if ( - element instanceof HTMLElement && - element.style.height.endsWith('vh') - ) { + if (element.style.height.endsWith('vh')) { const vhValue = parseFloat(element.style.height); const newHeight = (vhValue / 100) * height; element.style.maxHeight = newHeight + 'px'; -- GitLab