From b5306657e0b8cb80e9cddf1aa1b6fc022eec9647 Mon Sep 17 00:00:00 2001 From: Jerry Jones Date: Thu, 10 Oct 2024 09:27:07 -0500 Subject: [PATCH] Force px value for frameSize --- packages/block-editor/src/components/iframe/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index 293742f55683c5..a0a65e51dc0133 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -317,9 +317,11 @@ function Iframe( { prevContainerWidthRef.current : scale ); + + // frameSize has to be a px value for the scaling and frame size to be computed correctly. iframeDocument.documentElement.style.setProperty( '--wp-block-editor-iframe-zoom-out-frame-size', - typeof frameSize === 'number' ? `${ frameSize }px` : frameSize + `${ frameSize }px` ); iframeDocument.documentElement.style.setProperty( '--wp-block-editor-iframe-zoom-out-content-height',