web-stories-wp icon indicating copy to clipboard operation
web-stories-wp copied to clipboard

Editor does not cater for decorative images / videos

Open swissspidy opened this issue 4 years ago • 1 comments

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:

  1. 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's alt value (which is usually set and can't be easily removed). So it's not possible to have empty assistive text here
  2. 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

  1. 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

swissspidy avatar Dec 10 '20 16:12 swissspidy

Two options come to mind here:

  1. 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.
  2. 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.

swissspidy avatar Jul 15 '22 08:07 swissspidy