Skip to content

Commit

Permalink
add condition to set prev container width if not set
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed Oct 8, 2024
1 parent 622f41e commit 240932e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function Iframe( {
const isZoomedOut = scale !== 1;

useEffect( () => {
if ( ! isZoomedOut ) {
if ( ! isZoomedOut || ! prevContainerWidthRef.current ) {
prevContainerWidthRef.current = containerWidth;
}
}, [ containerWidth, isZoomedOut ] );
Expand Down

0 comments on commit 240932e

Please sign in to comment.