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 Block: Replacing Image can alter caption settings #66979

Open
4 of 6 tasks
MadtownLems opened this issue Nov 13, 2024 · 3 comments
Open
4 of 6 tasks

Image Block: Replacing Image can alter caption settings #66979

MadtownLems opened this issue Nov 13, 2024 · 3 comments
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@MadtownLems
Copy link

Description

When you have an Image Block (with Caption toggled off), and replace it with an Image from your Media Library that does have a caption, the Image Block gets its Caption setting toggled on (and uses the caption of the new Image block). This doesn't feel like expected behavior at all in typical contexts, and is very annoying when dealing with Block Patterns. Many of our Block Patterns make use of Image Blocks (withOUT captions). When users customize the Pattern with their own Image, a Caption suddenly pops up where nobody intended one to be (and is very easy to miss).

Step-by-step reproduction instructions

  1. Insert an Image Block. Make sure its caption is Off.
  2. Replace the media with an image from the Media Library that already has a Caption set
  3. See that the Image Block gets its Caption setting toggled On (when it was off) and the caption is unexpectedly displayed

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.7, no Gutenberg plugin

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@MadtownLems MadtownLems added the [Type] Bug An existing feature does not function as intended label Nov 13, 2024
@Mamaduka Mamaduka added the [Block] Image Affects the Image Block label Nov 14, 2024
@Mayank-Tripathi32
Copy link

@MadtownLems I am able to replicate the behavior and suspect it may be intentional; however, it could easily be perceived as a bug from a user’s perspective.

@t-hamano
Copy link
Contributor

While the current behavior is intended, I agree that this is a bit confusing.

Even in the Classic Editor, when you replace an image, the caption for the new image appears.

@MadtownLems
Copy link
Author

MadtownLems commented Nov 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants