-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Image block: images stretched on smaller devices unless a scale behaviour is set. If the selection is Contain, large margins are added. #79533
Comments
📌 SCRUBBING : RESULT - Replicated / Could Not Replicate / Uncertain
📌 FINDINGS/SCREENSHOTS/VIDEO
Screenshots/Recordingsd3qSap.movReplicated in Gutenberg 16.2.1, 16.2.0, 16.1.2, and with Gutenberg deactivated. 📌 ACTIONS
|
Reported here: WordPress/gutenberg#52739 |
It's likely the change is caused by this: p7DVsv-hV9-p2 @sgomes can you confirm this is the same case? In this case, until stage 3, the users cannot wait for images to be stretched on mobile. |
Hey @Robertght 👋 I can't seem to reproduce the issue, I'm afraid 😕 Does this require a particular theme? Without any further information, I doubt that the issue is related to the rollout in p7DVsv-hV9-p2, since that is not affecting any user blogs at the moment, but I'd like to make sure. |
Thank you to @filipanoscampos for a test case 👍 This seems to be unrelated to the rollout in p7DVsv-hV9-p2, as I expected. It looks like an issue with how this feature is implemented in Gutenberg. The element has the following styles: {
width: 545px;
height: 472px;
} But Gutenberg also adds the following: .wp-block-image img {
box-sizing: border-box;
height: auto;
max-width: 100%;
vertical-align: bottom;
} This means that when |
Another report in 6547432-zen |
Another in #6589094-zen |
Another report in 6604157-zd-woothemes, though I wasn't able to replicate in Firefox on Android. This user was reportedly able to resolve things by changing the "Scale" setting from Cover to Contain and choosing a different aspect ratio. |
Looks like a fix for this will be incoming with Gutenberg 16.5 in WordPress/gutenberg#53274 |
6641104-zd |
6642481-zd-a8c |
6640399-zd |
6689829-zen |
Reported in 6799728-zd-a8c |
Further reports here - do we know when the fix is to be rolled out or if it'll be retrospective to affected blocks?
|
@Aurorum Thanks for that ask! I just retested on a new Free Site in WordPress.com, and the issue is no longer present, so the fix has landed for new sites. Screen.Capture.on.2023-10-09.at.13-38-30.movAs for whether it's expected to retroactively apply to blocks, I'm not sure. I'll do some digging today to see what I can find out. |
@Aurorum Follow up - it looks like the fix applies to new image blocks, but existing image blocks that were created while this issue was in effect will need to be corrected. That's because when the image was created and resized, a height was applied to the image in the editor - upgrading Gutenberg past 16.5 (where the fix landed) does not make changes to those blocks. You can see an example of this test on a self-hosted site below, along with the manual correction needed: RzH20U.mp4TL;DRThe bug is fixed, but users will need to edit their image blocks and remove the height setting, which will clear that height and set it back to Auto. Once this is done, the CSS workaround is no longer needed. 📌 ACTIONS
|
Thanks @cuemarie - much appreciated. |
Quick summary
Recently, the Image Block received a much-welcomed scaling setting.
Yet, there appear to be some unexpected results.
If the image is resized and the user does not choose a scaling behavior, the image is stretched on mobile devices.
If the user chooses the option to contain the image size, there are large white margins added above and below the image on small devices.
Steps to reproduce
What you expected to happen
The image to adjust to the smaller width, without stretching or extra margins.
What actually happened
The image is stretched or, if we set it to contain, there is a large white margin above and below the image.
Impact
Most (> 50%)
Available workarounds?
Yes, difficult to implement
Platform (Simple and/or Atomic)
Simple and Atomic
Logs or notes
Available workarounds:
First reportedon this interaction 6549118-zd-woothemes
Related conversation, here: p1689669069885049-slack-C03TY6J1A
Update - see easier workaround in comments
The text was updated successfully, but these errors were encountered: