Skip to content

Commit

Permalink
Add div wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Jul 6, 2023
1 parent 8868427 commit fcbe60f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,10 @@ function Iframe( {
bubbleEvents( contentDocument );
setIframeDocument( contentDocument );
clearerRef( documentElement );
bodyRef( contentDocument.body );

contentDocument.body.classList.add( 'wp-block-editor__iframe' );
contentDocument.body.classList.add( 'editor-styles-wrapper' );

contentDocument.body.addEventListener( 'click', ( event ) => {
if ( event.target === contentDocument.body ) {
node.click();
}
} );

// Ideally ALL classes that are added through get_body_class should
// be added in the editor too, which we'll somehow have to get from
// the server in the future (which will run the PHP filters).
Expand Down Expand Up @@ -252,12 +245,12 @@ function Iframe( {
>
{ iframeDocument &&
createPortal(
<>
<div ref={ bodyRef }>
{ contentResizeListener }
<StyleProvider document={ iframeDocument }>
{ children }
</StyleProvider>
</>,
</div>,
iframeDocument.body
) }
</iframe>
Expand Down

0 comments on commit fcbe60f

Please sign in to comment.