Skip to content
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

Media & Text - image is stretched vertically on front end #35738

Closed
Sandstromer opened this issue Oct 18, 2021 · 3 comments
Closed

Media & Text - image is stretched vertically on front end #35738

Sandstromer opened this issue Oct 18, 2021 · 3 comments
Labels
[Block] Media & Text Affects the Media & Text Block Needs Testing Needs further testing to be confirmed.

Comments

@Sandstromer
Copy link

Description

In the Media & Text block the image is stretched vertically on the front end.

The image is not stretched in the editor as the .block-editor__container img CSS contains height: auto.

However on the front end height: auto is missing from the block styling: .wp-block-media-text__media img, .wp-block-media-text__media video

Step-by-step reproduction instructions

Add a Media & Text block
Select an image that with landscape dimensions (wider than the height)
Add enough text so that the text appears with a larger height than the image.
Leave the 'Crop image to fill entire column' option off.

View on front end and notice the image is stretched in the vertical.

Screenshots, screen recording, code snippet

Editor view:

media-text-image-editor-ok

Front end view:

media-text-image-front-stretched

Environment info

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

@Mamaduka Mamaduka added [Block] Media & Text Affects the Media & Text Block Needs Testing Needs further testing to be confirmed. labels Oct 18, 2021
@glendaviesnz
Copy link
Contributor

I wasn't able to replicate this on WP 5.8.1 & Gutenberg 11.7 with TwentyTwentyOne or TwentyTwentyOne-Blocks themes:

Screen Shot 2021-10-19 at 11 34 06 AM

@Sandstromer which version of Gutenberg and which theme are you using when you get this problem?

@Mamaduka
Copy link
Member

I think the issue was fixed via #30092 and should be part of Gutenberg 11.8.

@Sandstromer
Copy link
Author

@glendaviesnz - Gutenberg 11.7 and TT1-Blocks theme.

I don't see the issue with TwentyTwentyOne or some block themes such as Blockbase and Tove, as it they have their own img { height: auto; } CSS, but with a block theme that does not have this e.g. Twenty Twenty-Two or TT1-Blocks, the issue is present.

@Mamaduka - thank you for pointing out the PR. This will fix it so I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Media & Text Affects the Media & Text Block Needs Testing Needs further testing to be confirmed.
Projects
None yet
Development

No branches or pull requests

3 participants