FIX: Image stretch on width more than container size#70251
FIX: Image stretch on width more than container size#70251patil-vipul wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @patil-vipul! In case you missed it, we'd love to have you join us in our Slack community. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
|
@stokesman, any thoughts on the proposed fix? I'm not sure if this is related to the recent image resizable refactoring. |
As far as I can tell that refactoring fixed the issue this is aimed at. I worry I might be missing something but I can't reproduce it. I commented on the original issue. |
|
Hi @patil-vipul, this issue seems to be solved in the latest Gutenberg. I'm going to close this PR, but thank you for your efforts! |
|
@t-hamano Understood, thanks for your inputs 🙇. |
What?
Closes: #70250
Fix image block aspect ratio distortion when resizing beyond container width
Why?
When users resize an image block beyond the container width in the block editor, the image becomes vertically stretched and distorted, breaking the aspect ratio. This creates a visual inconsistency between the editor and frontend, where the frontend correctly maintains aspect ratio but the editor shows a distorted image.
The issue is caused by height: inherit in the ResizableBox CSS rule, which forces the image to take the manually set height value even when the width is constrained by the container. This affects user experience as the editor preview doesn't match the actual frontend appearance.
How?
Screenshots or screencast
|

|
|