WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.5k stars 4.2k forks source link

Gallery block refactor: Replacing a captioned image with one without caption retains the caption #34862

Open andrewserong opened 3 years ago

andrewserong commented 3 years ago

During testing of the gallery refactor it was reported that if you replace an image with a caption with an image without a caption, the caption on the image is retained, which might not be the expected behaviour.

I could replicate this, and I had a couple of thoughts:

  1. As a user I might have the right caption in mind, but be trying out a few different possible images. In this case, I'd want the caption to be retained (so the current behaviour could be expected).
  2. Or, as a user, I might be trying to replace the image altogether so the retained caption could be unexpected and feel like something's broken.

I think I'm leaning toward thinking that we should default to the second expectation. Here's a screengrab of the current behaviour, where the caption is retained:

Kapture 2021-09-16 at 14 57 54

annezazu commented 2 years ago

This came up as part of the FSE Outreach Program's All Things Media exploration:

It would be nice that when an image is changed in a gallery that the previous caption entered through the block editor and not the media editor would also go away. Currently, the old captions will still show after the image has been swapped.