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

Post Featured Image dimension settings not displaying properly on smaller screens #48988

Open
Thelmachido opened this issue Mar 10, 2023 · 8 comments · Fixed by #49641
Open
Labels
[Block] Post Featured Image Affects the Post Featured Image Block [Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended

Comments

@Thelmachido
Copy link

Description

If you set dimension settings for the featured images within the Query Loop the featured images are not reduced to scale on smaller screens. For example, I set the featured image size to 520px in Height and 370px in width.

I expected the content within the block to be displayed properly and for images to be reduced in scale when the screen size is smaller.

This was reported in forums: https://wordpress.org/support/topic/query-loop-images-overlap-when-reszing-window/

Step-by-step reproduction instructions

  1. Add the Query Loop block to a page
  2. Add the post-featured image block
  3. Change the dimension settings for the featured image to 520px by 370px
  4. Check the page on a smaller screen e.g 768px by 1024px

You will see that the content inside the query loop will extend to the right and the images will be overlapping.

Screenshots, screen recording, code snippet

Screenshot 2023-03-10 at 16 51 20

Environment info

  • Gutenberg version 15.3.1
  • WP 6.1.1
  • TT3 theme

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

@Thelmachido Thelmachido added [Type] Bug An existing feature does not function as intended [Block] Query Loop Affects the Query Loop Block labels Mar 10, 2023
@ndiego ndiego added the Needs Testing Needs further testing to be confirmed. label Mar 14, 2023
@ndiego
Copy link
Member

ndiego commented Mar 14, 2023

I am able to replicate this issue in WP 6.1.1 and 6.2 RC1 with and without Gutenberg enabled. I appears there is a missing max-width: 100%; somewhere. I will look into a solution this week.

@ndiego
Copy link
Member

ndiego commented Apr 6, 2023

This appears to be a larger issue due to the way width and height are applied to the Featured Image block. A similar issue was discovered in #49561 (comment) and also in #48892.

From what I am seeing, there are a couple of things going on here. First, the placeholder in the Editor does not render properly when custom dimensions are applied.

image

The placeholder does not match what actually appears on the frontend. In the screenshot below, the image is not 1000px, but is rendering correctly since the block is constrained to "Content" width.

image

Next, the Featured Image block is no longer responsive on smaller screens. Notice how it is overflowing the container in the screenshot below. This is because the block has a width of 1000px and a max-width equal to the defined "Content" size, which is larger than the screen size.

image

While I don't believe there is an actual bug here since this is just how CSS works (other than the placeholder not resembling the frontend), this implementation of height and width settings is quite unintuitive and, in many situations, unusable.

@ndiego ndiego changed the title Query Loop Block dimension settings not displaying properly on smaller screens Post Featured Image dimension settings not displaying properly on smaller screens Apr 6, 2023
@annezazu annezazu moved this to 🐛 Punted to 6.2.1 in WordPress 6.2 Editor Tasks Apr 6, 2023
@annezazu
Copy link
Contributor

annezazu commented Apr 6, 2023

Adding this to the 6.2.1 board in particular to resolve the placeholder issue as that is important to address. In talking with @richtabor, it became clear that the root problem is around the experience of using height/width controls, including the direction of aspect ratio which is being shaped here: #47963 (comment) Noting for future reference!

@ntsekouras
Copy link
Contributor

I opened a draft PR here. Some of this sizing issues were introduced here for aspect ratio. There are many conditions about when to add what style, so maybe @ajlende has more insights about the fixes.

@ntsekouras ntsekouras self-assigned this Apr 20, 2023
@github-project-automation github-project-automation bot moved this from ❓ Triage to ✅ Done in WordPress 6.2.x Editor Tasks Apr 20, 2023
@github-project-automation github-project-automation bot moved this from 🐛 Punted to 6.2.1 to ✅ Done in WordPress 6.2 Editor Tasks Apr 20, 2023
@ntsekouras
Copy link
Contributor

It seems there are some nuances that need more thought on how to handle them(see #49641 (comment)) and I've create a PR to revert the maxSize previous attempt. So I'm reopening this one.

@ntsekouras ntsekouras reopened this May 8, 2023
@Mamaduka Mamaduka moved this from ✅ Done to 📥 Todo in WordPress 6.2 Editor Tasks May 8, 2023
@Mamaduka Mamaduka moved this from ✅ Done to ❓ Triage in WordPress 6.2.x Editor Tasks May 8, 2023
@Mamaduka Mamaduka moved this from 📥 Todo to 🐛 Punted to 6.2.1 in WordPress 6.2 Editor Tasks May 8, 2023
@Thelmachido
Copy link
Author

This was also reported recently on the following forum issue:

https://wordpress.org/support/topic/featured-image-in-a-post-not-responsive-doesnt-resize-on-mobile/

@ntsekouras ntsekouras removed their assignment May 16, 2023
@jordesign
Copy link
Contributor

This is still replicable in WP6.4 beta 4.

Screenshot 2023-10-17 at 7 38 53 am

@annezazu this dropped off 6.2 due to prioritisation - but just wanted to see if it has importance for 6.4?

@annezazu
Copy link
Contributor

I'm afraid it's too late for 6.4. I'll add to the 6.5 part of the board for consideration and the polish board for now. Thanks for the ping!

@annezazu annezazu moved this to Punted to 6.5 in WordPress 6.4 Editor Tasks Oct 17, 2023
@annezazu annezazu added this to Polish Oct 17, 2023
@annezazu annezazu moved this to Needs development in Polish Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Featured Image Affects the Post Featured Image Block [Block] Query Loop Affects the Query Loop Block [Type] Bug An existing feature does not function as intended
Projects
Status: Needs development
Status: Punted to 6.5
Development

Successfully merging a pull request may close this issue.

5 participants