-
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
Mobile - Image block - Fix issue with set width and height images #51463
Conversation
Size Change: +1.66 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Hey @SiobhyB 👋 I've added you as a reviewer for this PR let me know if you can take a look, thank you! |
Flaky tests detected in 07681a0. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5277592909
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing @geriux!
While testing, I noticed that switching between image sizes leads to Full Size
images always taking up the full width of the block. I'd expect a Full Size
image to alway display proportional to the image's actual size, as it is upon first opening the editor (with this fix applied). As this can be reproduced against trunk
and is separate to how the block appears upon first load, I don't consider it a blocker to this PR, but maybe something relevant to address separately.
image-resize.mov
I can confirm that the main issue of image sometimes appearing cut off upon first load is now fixed, thanks again Gerardo! 👏 👏 🎉
Thanks for testing and reviewing!
Did the image have a set width value? Those values are used before using the size value that is set so for example when you change the size of the image on the mobile editor (Medium, Large, Full Size), it removes the previously set width and height values from the web editor. So it causes confusion 😅 Ideally, we should support having the width and height controls on the mobile editor. |
Yes, it was the image provided as part of the testing steps in this PR. So, against
@geriux, thanks for clarifying the root issue here! I agree that supporting the width and height controls in the native editor seems ideal. For the issue at hand, I think this PR is a good solution in the meantime. 🙇♀️ |
…rdPress#51463) * Mobile - Image block - Fix issue with set width and height images * Mobile - Update changelog
Fixes wordpress-mobile/gutenberg-mobile#5091
What?
Fixes an issue with the Image block and set width and height values for some images.
Why?
To show the right aspect ratio regardless if the image has a set with/heigh value or not.
How?
By avoiding setting a set height value (from the container) if the image has a set width value.
Currently you can't set a custom width/height from the mobile editor but you can from the Web editor.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast