-
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
Patterns using VH units or fixed background vertically expanding their previews endlessly #34729
Comments
Thank you for the ticket. I can reproduce this in The pattern in question uses both the cover block's fixed-position property and the has a height of
It appears to be the iframe auto-resize function that keeps firing, possibly because |
@jasmussen It looks like there are other browsers and OS's(& versions) affected by this: Automattic/wp-calypso#56182 |
I took the liberty of updating the title a bit. |
I was able to reproduce it with the Coming Soon patterns too. bug-block-pattern-height-expanding-indefinitely-2021-09-21-at-09.mp4 |
Investigation note:
|
I saw this with Skatepark too. BlockPreview already has a viewportWidth prop. Can we provide a similar default for viewportHeight? Patterns that use vh should probably explicitly set this when registering the pattern. In addition to this we can set a max height (so we don't get silly results). CleanShot.2021-10-15.at.11.36.41.mp4 |
I'm working on this and I think I've find a good solution. I'll send a PR shortly. |
Use iframe content height as the iframe height, but cap it to the arbitrary but reasonable aspect ratio of 1:1. This prevents vh units from making the iframe grow forever. Fixes: WordPress#34729
PR ready #35841 |
Just a heads up that I've temporarily removed |
I wanted to circle back on this issue as it's a pretty important one, especially as patterns become a more integral part of the building experience. I have been unable to diagnose the root cause, but I did want to highlight an incredibly easy way to reproduce this using native block controls.
What strange is while I am able to reproduce this in the latest version of Gutenberg, this issue does not appear to exist In WordPress 5.9 RC3! The same pattern in RC3 without Gutenberg active looks like this: Very curious 🤔 |
I've been able to replicate this, but only with vh units set to |
I have reproduced this issue as well when activating Gutenberg 12.5.x. I found it especially noticeable in Twenty Twenty One theme, and less apparent in Twenty Twenty Two. large.header.vh.mp4Mac Monterey, Chrome Version 97.0.4692.71, running site in LocalWP, 5.9RC3 |
Can the folks here who are able to reliably reproduce the issue please go and test whether #35841 fixes it? |
I share my video from WordPress Core's Trac. This bug exists with all bundled themes except Twenty Twenty-Two. Kapture.2022-01-23.at.19.09.59.mp4#35841 seems to provide a minimum fix. Blocks still expand vertically but stop at the aspect ratio 1:1. Kapture.2022-01-24.at.14.00.51.mp4WordPress: trunk, 5.9-RC3 |
I noticed that this bug occurs with non-block themes. The bug is caused by the vertical margin applied to previews of gutenberg/packages/edit-post/src/classic.scss Lines 28 to 29 in 2484854
|
Hello all 👋 PR #38175 has been merged and will be backported to Core to include in 5.9 RC4 and final release. Thank you everyone for contributing! |
Description
This is a replica of this issue: Automattic/wp-calypso#56077
Step-by-step reproduction instructions
Steps to Reproduce
I tested this on Chrome and did not see the same error/issue.
In Safari, I also got an error that "This webpage is using significant memory. Closing it may improve the responsiveness of your Mac."
I'm currently running Safari Version 14.1.2 (16611.3.10.1.6) on macOS Big Sur, version 11.5.2. 16" 2019 MacBook Pro.
Video of the error:
Screen.Recording.2021-09-07.at.2.27.37.PM.mov
Screenshots, screen recording, code snippet
No response
Environment info
Operating System
macOS
OS Version
11.5.2
Browser
Safari
Browser Version(s)
14.1.2
Is this specific to applied theme? If so, what is the theme name?
I tested using Blank Canvas and also Bradford. Issue happened on both themes.
Console and/or error logs
No response
Available Workarounds
You can use a different web browser - I was able to select a header pattern in Chrome.
Reproducibility
No response
Other information
No response
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: