-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Site Editor: Browse styles expand indefinitely when a cover block is in template #57405
Comments
Similar issues have been reported several times in the past. We need to find a fundamental solution to this problem.
|
Thanks for diving into the prior related issues :D Was going to do that today since I know I've opened a few already. |
In WordPress 2023 theme it's noticeable on the home template with posts that have featured images. I hinted at it over in #52297 (comment) - if it's the CSS transition delay that's causing the race condition between height calculation and animation, I'd be open to ditching these transitions completely. E.g., diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js
index 1939f75811..ddada79746 100644
--- a/packages/block-editor/src/components/iframe/index.js
+++ b/packages/block-editor/src/components/iframe/index.js
@@ -264,7 +264,8 @@ function Iframe( {
scale !== 1
? `scale( ${ scale } )`
: props.style?.transform,
- transition: 'all .3s',
+ //transition: 'all .3s',
+ transition: 'none',
} }
ref={ useMergeRefs( [ ref, setRef ] ) }
tabIndex={ tabIndex } |
Ran into this again and 😭 -ed. This would be such a nice quality of life to have fixed. |
I've tried to find a way to mitigate this again. Here's a brain dump of what I'm seeing. The issue can be recreated by inserting some containing blocks with To test, I'm previewing the editor via "Browsing styles" in the site editor, which triggers the resizeObserver. Here's some test HTML: <!-- wp:group {"style":{"dimensions":{"minHeight":"100vh"}},"layout":{"type":"constrained"}} -->
<!-- wp:group {"style":{"dimensions":{"minHeight":"30.8vh"}},"layout":{"type":"constrained"}} -->
<div class="wp-block-group" style="min-height:30.8vh"><!-- wp:image {"id":37,"sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image size-full"><img src="http://localhost:8888/wp-content/uploads/2024/01/white-bellied-swallow.jpg" alt="" class="wp-image-37"/></figure>
<!-- /wp:image --></div>
<!-- /wp:group --></div>
<!-- /wp:group --> From what I can see, the Iframe's useResizeObserver is trying to calculate the height of the window as it's growing. Element "A", with a The transition of The only way I could stop this was to restrict the zoomed out editor's height based on the iframe's surrounding container height. I also turned off the transition because it's not helpful. I'm not sure this is the right way though — it's a hack — just posting this in case other folks have ideas. |
I believe this issue has been fixed in #59334, but if you can reproduce this issue on trunk, feel free to reopen it at any time. |
Description
If you add a cover block to a template in the Site Editor and open Styles > Browse Styles, the canvas will start to expand indefinitely.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Screen.Recording.2023-12-27.at.12.51.51.PM.mov
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: