eslint-plugin-jsx-a11y icon indicating copy to clipboard operation
eslint-plugin-jsx-a11y copied to clipboard

allowing aria-labelledby in img

Open nickydonna opened this issue 6 years ago • 4 comments

The current rules for alt-text don't allow images with aria-labelledby to have no alt. But it seems that the w3 has documentation regarding this technique: https://www.w3.org/WAI/GL/wiki/Using_aria-labelledby_to_provide_a_text_alternative_for_non-text_content

The use case I'm referring to is when I have an image an immediately below it, I have the text for that image, wouldn't that make an screen reader read the same text twice??

nickydonna avatar Mar 20 '18 18:03 nickydonna

Any news regarding this??

nickydonna avatar Mar 26 '18 18:03 nickydonna

@donnanicolas I'm swamped with work-work. If you put up a PR, I'm happy to review!

jessebeach avatar Mar 26 '18 20:03 jessebeach

I'm curious about something similar to this, would <img aria-label="Close" src=.../> (without alt) be correct? Today the plugin doesn't like this style. Likewise for <img title="Close" src=.../>. Perhaps I misunderstand the semantics of aria-label/title/alt ?

dimaqq avatar Jun 16 '20 07:06 dimaqq

I'm curious about something similar to this, would <img aria-label="Close" src=.../> (without alt) be correct? Today the plugin doesn't like this style. Likewise for <img title="Close" src=.../>. Perhaps I misunderstand the semantics of aria-label/title/alt ?

@dimaqq you can test the AX Tree output for the variations in Chrome's Accessibility Panel in the DOM Inspector. I think they'll all produce the correct AX Tree output, so functionally they should be equivalent and there's some improvement to be made in this rule's behavior.

jessebeach avatar Jun 16 '20 20:06 jessebeach