From 38b48cc5f874913b44606408baa2a8428398519a Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Thu, 10 Aug 2023 11:55:16 -0700 Subject: [PATCH 1/2] Fix support of sticky position in non-iframed post editor --- .../src/components/visual-editor/index.js | 17 +++++++++-------- .../src/components/visual-editor/style.scss | 4 +++- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index fe14ef0556113..aebef455fe74d 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -334,11 +334,19 @@ export default function VisualEditor( { styles } ) { .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;} .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`; + const isToBeIframed = + ( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) && + ! hasMetaBoxes ) || + isTemplateMode || + deviceType === 'Tablet' || + deviceType === 'Mobile'; + return ( diff --git a/packages/edit-post/src/components/visual-editor/style.scss b/packages/edit-post/src/components/visual-editor/style.scss index 00678f9867ec3..456790eb5bc0c 100644 --- a/packages/edit-post/src/components/visual-editor/style.scss +++ b/packages/edit-post/src/components/visual-editor/style.scss @@ -2,7 +2,9 @@ position: relative; display: flex; flex-flow: column; - overflow: hidden; + &.is-isolated { + overflow: hidden; + } // Gray preview overlay (desktop/tablet/mobile) is intentionally not set on an element with scrolling content like // interface-interface-skeleton__content. This causes graphical glitches (flashes of the background color) From 761979e20e6cf0a3ca42336a349e802c4481f87b Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Fri, 11 Aug 2023 09:09:15 -0700 Subject: [PATCH 2/2] Invert class/style application and comment --- packages/edit-post/src/components/visual-editor/index.js | 2 +- packages/edit-post/src/components/visual-editor/style.scss | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index aebef455fe74d..f888630afeca1 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -346,7 +346,7 @@ export default function VisualEditor( { styles } ) { __unstableContentRef={ ref } className={ classnames( 'edit-post-visual-editor', { 'is-template-mode': isTemplateMode, - 'is-isolated': isToBeIframed, + 'has-inline-canvas': ! isToBeIframed, } ) } >