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

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

Open
dpasque opened this issue Feb 21, 2023 · 0 comments
Labels
[Block] Group Affects the Group Block [Block] Image Affects the Image Block [Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended

Comments

@dpasque
Copy link

dpasque commented Feb 21, 2023

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Block] Image Affects the Image Block [Block] Group Affects the Group Block [Feature] Layout Layout block support, its UI controls, and style output. labels Feb 22, 2023
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 [Block] Image Affects the Image Block [Feature] Layout Layout block support, its UI controls, and style output. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

2 participants