web-stories-wp
web-stories-wp copied to clipboard
Editor does not cater for decorative images / videos
Bug Description
Decorative images don’t add information to the content of a page. For example, the information provided by the image might already be given using adjacent text, or the image might be included to make the website more visually attractive.
In these cases, a null (empty) alt text should be provided (alt=""
) so that they can be ignored by assistive technologies, such as screen readers.
(source)
At the moment, it is not possible to have decorative images in the editor for two reasons:
- If I leave the "Assistive Text" field for the element in the Design Panel empty (hoping for
alt=""
), image output and pre-publish checklist will fall back to the resource'salt
value (which is usually set and can't be easily removed). So it's not possible to have empty assistive text here - The pre-publish checks warns users if the image doesn't have assistive text, so basically forces you to add some.
Expected Behaviour
I should be able to somehow add decorative images (and videos), with empty alt
text, without issues.
Steps to Reproduce
- Add image/video/GIF and try to leave assistive text field empty.
Screenshots
Additional Context
- Plugin Version: 1.2
- WordPress Version: 5.6
- Operating System: macOS
- Browser: Chrome
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance Criteria
Implementation Brief
Two options come to mind here:
- Add a checkbox below the textarea that says "This is a decorative image/video that does not require alt text" If the checkbox is toggled, we could make the textarea readonly and gray it out.
- In the pre-publish checklist, if there's a warning about missing alt text, provide an "Ignore" button if the image is decorative This will also toggle the checkbox.