Skip to content

Image blocks within row blocks do not have custom sizings supported on published page #48295

Open

Description

@dpasque

Description

If you add an image block into a row block, and then set custom sizings for that image block (whether by dragging to resize, or setting a % in the block settings sidebar), that custom sizing won't be supported on the published page view.

Step-by-step reproduction instructions

  1. Open a new post or page
  2. Add a row block
  3. Add an image block as the first block. Resize the image to a custom size.
  4. Add a paragraph block as the second block. Make sure it's pretty long -- long enough to affect the flex sizing calculations.
  5. Publish and view the post.

Screenshots, screen recording, code snippet

For example, here is an image in the editor:
Screen Shot 2023-02-21 at 2 45 06 PM

... and that same row/image on the published page:
Screen Shot 2023-02-21 at 2 45 16 PM

From what I can tell, this seems to maybe be an artifact of the differences in how we apply that sizing combining with the flex display here.

In the editor, we wrap the img in a div with some styling set directly in the style attribute, including some additional flex handling. In the published page, there is no such wrapping div, and the size is just translated to width and height attributes directly on the img.

Environment info

Theme was Twenty Twenty-Three, but it reproduces on multiple.

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

Activity

  1. added
    [Type] BugAn existing feature does not function as intended
    [Block] GroupAffects the Group Block (and row, stack and grid variants)
    [Feature] LayoutLayout block support, its UI controls, and style output.
    on Feb 22, 2023
  2. hanneslsm commented on Jul 7, 2026

    @hanneslsm

    Still relevant, WP 7.0, however I think the issue with the discrepancy between editor and front-end has been solved.

    I think that the images shouldn't shrink though, when a image width was defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] GroupAffects the Group Block (and row, stack and grid variants)[Block] ImageAffects the Image Block[Feature] LayoutLayout block support, its UI controls, and style output.[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions