Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Changing image block size does not change caption placement. #890

Closed
paaljoachim opened this issue Nov 25, 2020 · 2 comments
Closed

Changing image block size does not change caption placement. #890

paaljoachim opened this issue Nov 25, 2020 · 2 comments
Labels
[Type] Bug Something isn't working

Comments

@paaljoachim
Copy link

Describe the bug
I am using the newest version of the theme 2021.

Changing the Image size of the Image block to Medium or Thumbnail does not move the caption to stay centered below the image.

Screen Shot 2020-11-25 at 16 50 37

Screen Shot 2020-11-25 at 16 50 49

To Reproduce
Steps to reproduce the behavior:

  1. Add an Image block and an image with a caption through the media library.
  2. See the caption centered below the image on "Large" and "Full Size"
  3. Change the Image size to Medium or Thumbnail.
  4. Notice the caption stay in the same place. Caption does not stay centered below the image.

Expected behavior
I expect the caption to stay centered below the image for all image sizes.

Screenshots

Image-caption-2021

WordPress: 5.5.3
No plugins activated.


The same result with Gutenberg plugin 9.4.1 activated.

@carolinan
Copy link
Contributor

carolinan commented Nov 26, 2020

This seems to be a long-standing editor issue that has already been reported in the Gutenberg repo.
It is because the image is resized, but the wrapper is not.

Please remember to include references to your previous issues:
WordPress/gutenberg#13684
WordPress/gutenberg#17162

I found another recent reference here but I don't think a new issue was created. @tellthemachines may be able to confirm.
WordPress/gutenberg#26376 (review)

I tried the various margin and display: table-caption tricks mentioned in these issues/pull requests with no luck.
With display: table on the wrapper when resized, the image itself is not aligned.
With display: table-caption on the figcaption, the text is too narrow and left aligned instead of centered.

caption

@tellthemachines
Copy link

I found another recent reference here but I don't think a new issue was created. @tellthemachines may be able to confirm.
WordPress/gutenberg#26376 (review)

WordPress/gutenberg#17162 reports the issue I mentioned above, so I didn't open a new one. This comment explains some of the complexities behind it. Doesn't mean we shouldn't try to fix it though 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
[Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants