Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Apr 12, 2024
1 parent 93903b4 commit fec3423
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ function Iframe( {
clearerRef,
writingFlowRef,
disabledRef,
// Avoid resize listeners when not needed, these will trigger
// unnecessary re-renders when animating the iframe width, or when
// expanding preview iframes.
scale === 1 ? null : windowResizeRef,
] );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ export default function SiteEditorCanvas( { onClick } ) {
settings={ settings }
onClick={ onClick }
>
{ enableResizing && resizeObserver }
{
// Avoid resize listeners when not needed,
// these will trigger unnecessary re-renders
// when animating the iframe width.
enableResizing && resizeObserver
}
</EditorCanvas>
</ResizableEditor>
</div>
Expand Down

0 comments on commit fec3423

Please sign in to comment.