diff --git a/src/components/block-editor/index.js b/src/components/block-editor/index.js index 6b236cc8..1be804ed 100644 --- a/src/components/block-editor/index.js +++ b/src/components/block-editor/index.js @@ -125,13 +125,21 @@ function BlockEditor( props ) { // For back-compat with older iso-editor useEffect( () => { + const html = document.querySelector( 'html' ); + if ( isFullscreenActive ) { // @ts-ignore - document.querySelector( 'html' ).classList.add( 'is-fullscreen-mode' ); + html.classList.add( 'is-fullscreen-mode' ); } else { // @ts-ignore - document.querySelector( 'html' ).classList.remove( 'is-fullscreen-mode' ); + html.classList.remove( 'is-fullscreen-mode' ); } + + return () => { + if ( html ) { + html.classList.remove( 'is-fullscreen-mode' ); + } + }; }, [ isFullscreenActive ] ); return (