-
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
Featured image doesn't display height in edit view if it's an .svg file #5477
Comments
@jorgefilipecosta, I'm interested in working on this if you haven't started already. |
Sure @Kluny feel free to work on it. Thank you for your interest 👍 |
@jorgefilipecosta, I've pushed a fix for this. Will you review it for me? |
Hi @Kluny thank you for submitting the PR, another contributor already reviewed it :) |
Hi, Currently using WP Version 5.0.3 and this is still an issue. What version is this likely to be corrected within? |
It seems like there is a related discontinued PR here: #5577 Reviving it would likely fix this issue. |
I'll try to reproduce it... |
I was able to replicate this issue using a clean install of WP 5.8 and the latest Gutenberg version. It didn't appear to be directly related to the presence or not of a The post's feature image gets rendered within a One very rough option could be for the responsive wrapper to check for an
I'm not sure what the consequences of such a change would be. Unfortunately, I don't have the bandwidth at the moment to continue working on this. Happy to assist or review a PR for anyone else that picks this up. |
I tested this on the most recent Gutenberg version 13.7.3, on the Twenty Twenty-Two theme. I wasn't able to replicate the issue as shown in the screenshots below: On this image, I add the SVG featured image. The featured image section is looking as expected, the image isn't overflowing as before. Closing this issue for now. |
The feature image gets rendered within a ResponsiveWrapper. That relies on the image's height and width being able to be determined. In the PostFeaturedImage component, it isn't able to do that for an SVG. This leads the ResponsiveWrapper assigning an undefined value to the paddingBottom style. As suggested, I added a check for an undefined value and in that case set padding bottom to 100%. Props aaronrobertshaw, Mamaduka. Fixes WordPress#48184, WordPress#5477.
Issue Overview
If you enable .svg uploads and set one as a featured image the image container collapses and it doesn't know the correct height.
Tested on version 2.3.0
Steps to Reproduce (for bugs)
Expected Behavior
Display image at full height within featured image section.
Current Behavior
Displays image at full height but container height is 0. Image is overflowing.
Screenshots / Video
The text was updated successfully, but these errors were encountered: