Opened 6 months ago
Closed 5 months ago
#63800 closed defect (bug) (invalid)
Image Block: Alt Text resets when replacing image in block
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Editor | Keywords: | close |
| Focuses: | accessibility | Cc: |
Description
Steps to reproduce:
Create a new post or page.
Add an Image block.
Upload an image.
In the Block Settings sidebar, enter custom Alt Text (alternative text).
Without deleting the block, click Replace → Open Media Library and choose a different image.
Observe the Alt Text field.
Expected behavior:
The Alt Text field should remain unchanged until the user manually edits or clears it.
Actual behavior:
When replacing an image inside the same block, the Alt Text resets to blank.
Attachments (3)
Change History (9)
#2
in reply to:
↑ 1
@
6 months ago
In my opinion, this would be an expected behavior.
I agree.
One case where the first alt text could also fit the replacement is if the image has a custom link, because then the alternative text would describe the link target. However, using the Replace feature also removes custom links.
When replacing an image inside the same block, the Alt Text resets to blank.
The sidebar field would reset to blank if the image in the library has blank alt text, but any alternative text assigned to the new image in the library would be inserted in the block (and its sidebar settings).
#3
@
6 months ago
- Keywords close added
Adding close keyword, but waiting for reporter feedback before eventually closing it.
This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.
6 months ago
#5
@
6 months ago
This seems very use-case specific. In some contexts, replacing an image could need to retain the same alt text, but there's an equal or greater chance that you'll need a different alt text.
I think that this needs to remain the author's responsibility to verify and address alt text; there's no programmatic option we could pick that would be reliably "correct", so it's best to consistently use the alt text that's currently stored with the image.
I'll leave this open for a few days if @rahultank has any additional follow-up, but I don't think this is something we're likely to change.
In my opinion, this would be an expected behavior.
Indeed, when an image is replaced, there is a strong chance that the best alt text for the new image won't be the same one than with the previous one.
Of course, we could keep the alt text unchanged, but in this case we should also add a "don't forget to verify your alt text" heads up message, which sounds overkill to me :)