Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

update rule: react-a11y-img-has-alt - should allow role='presentation' with non-empty alt text. #298

Closed
ipip2005 opened this issue Oct 21, 2016 · 0 comments · Fixed by #299
Milestone

Comments

@ipip2005
Copy link
Collaborator

ipip2005 commented Oct 21, 2016

There is a specific scenario that I pasted in the issue #298
we should allow role='presentation' appears with non-empty alt text. Like

<img
  aria-hidden={ true }
  role='presentation'
  src='...'
  alt='<non-empty> alt text'
/>

In following situation:


<img alt='123'/>
<span>123</span>.

Sometimes the alt text equals to the nearest text. The alt text is no need to be discoverable by assistive technologies. But they should exist to show for sighted user once this img fails loading.
For screen reader users, they only be able to 'see' one text around (e.g. there is a img with alt='apple' and there is a span text near it apple, than screen reader users only see one of them)
For sighted users, they both see the img and the span, but in the situation that the img fails loading, sighted users should know which image failed loading by seeing the alt text at the position of that image.
This is for a better support for both screen reader users and sighted users.
So the following format should be acceptable:

<img aria-hidden='true' role='presentation' alt='123' />
<span>123</span>
ipip2005 added a commit that referenced this issue Oct 25, 2016
 - consumers can now specify this options to declare whether there project supports Non-empty alt text with role equals presentation.
 - add one test case for the enabled option.
 - closes #298
ipip2005 added a commit that referenced this issue Oct 25, 2016
- consumers can now specify this options to declare whether there project supports Non-empty alt text with role equals presentation.
 - add one test case for the enabled option.
 - closes #298
@HamletDRC HamletDRC added this to the 2.0.14 milestone Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants