Twitter allows users to add alt text to their images when adding them to a tweet. The API also exposes this to us for photo media types. We should use that user-provided alt test as descriptive text on the img if provided.
Additionally, since the <Image /> is the only descendant of the containing <a>, an aria-label on the anchor is duplicative. A screen reader will use the img alt tag as the anchor text. Removing the aria-label attribute will keep a screen reader from reading out the same text twice in row.
Twitter allows users to add
alt
text to their images when adding them to a tweet. The API also exposes this to us for photo media types. We should use that user-provided alt test as descriptive text on theimg
if provided.Additionally, since the
<Image />
is the only descendant of the containing<a>
, anaria-label
on the anchor is duplicative. A screen reader will use theimg
alt tag as the anchor text. Removing thearia-label
attribute will keep a screen reader from reading out the same text twice in row.Example tweet where alt text is provided