Closed tomtuv closed 9 months ago
Hi @tomtuv
Yes, you're right.
This will be done in the next version.
I'll keep you informed.
@mbgspcii Great news! Thanks for your quick response.
Hi @tomtuv
We have just deployed version 0.23.2, which takes into account your request concerning the alt property.
In this version, the alt
default value becomes an empty string.
We've also added to our roadmap the addition of the ARIA role img to our components.
Once again, we'll keep you informed.
Hoping 0.23.2 will suit your current needs.
Regard.
At the moment, the
<TwicImg>
React component replaces empty strings (even when deliberately added) with the image filename inalt
attributes.An empty
alt
attribute indicates to assistive technologies that the image is decorative and should be ignored. It is not the same as not having the attribute at all.I've tried to add an ARIA role of
presentation
to the component which does the same thing as an emptyalt
attribute but it is not added to the<img>
element. It would be useful if we could pass attributes to it as well.Also, I think the default value when no
alt
attribute is specified should be empty strings instead of the image filename. This is what Next.js does for example with their<Image>
component. It's better to hide the image for screen readers than to let them announce it with a potentially computer-generated filename.For reference: