Skip to content

Commit

Permalink
conditionally reset zoom level
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed Oct 11, 2024
1 parent a1ca1d1 commit aa24cf9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,13 @@ function Iframe( {
_src,
() => {
URL.revokeObjectURL( _src );
resetZoomLevel();
__unstableSetEditorMode( 'edit' );
if ( isZoomedOut ) {
resetZoomLevel();
__unstableSetEditorMode( 'edit' );
}
},
];
}, [ html, resetZoomLevel, __unstableSetEditorMode ] );
}, [ html, resetZoomLevel, __unstableSetEditorMode, isZoomedOut ] );

useEffect( () => cleanup, [ cleanup ] );

Expand Down

0 comments on commit aa24cf9

Please sign in to comment.