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

Grid: Aspect ratio controls are disabled on Image blocks in Grids #62889

Closed
ndiego opened this issue Jun 26, 2024 · 0 comments · Fixed by #62891
Closed

Grid: Aspect ratio controls are disabled on Image blocks in Grids #62889

ndiego opened this issue Jun 26, 2024 · 0 comments · Fixed by #62891
Assignees
Labels
[Block] Group Affects the Group Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@ndiego
Copy link
Member

ndiego commented Jun 26, 2024

Description

If you add an Image block to a Grid, the Aspect Ratio and Width/Height controls are disabled. The Width/Height makes sense since the actual width and height of the image will be dictated by the grid layout, but the Aspect Ratio should still be enabled, in my opinion. Perhaps this is intentional, but it feels like a bug.

I ran into a situation where I had a number of images that all had different aspect ratios. I wanted to set them all to"Square" and then arrange them in the new Grid block. After inserting the images, I realized the Aspect Ratio control no longer appeared in the block inspector. However, if I added an Image outside of the Grid and set the aspect ratio to "Square", I could then move it into the Grid, and the aspect ratio would be preserved. The video below provides a walkthrough.

Step-by-step reproduction instructions

  1. Use WordPress 6.6 or Gutenberg trunk
  2. Add a Grid block
  3. Add a few images with different aspect ratios to the Grid
  4. Notice that the Aspect Ratio control is not visible
  5. Add an Image block outside of the Grid, notice that the Aspect Ratio control is visible, and set it to "Square"
  6. Now move that Image block inside of the Grid and notice that the aspect ratio is preserved

Screenshots, screen recording, code snippet

grid-image-aspect-ratio.mp4

Environment info

  • WordPress 6.6
  • Gutenberg trunk

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

@ndiego ndiego added [Type] Bug An existing feature does not function as intended [Block] Group Affects the Group Block labels Jun 26, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
2 participants