gravity-ui / uikit

https://gravity-ui.com
MIT License
516 stars 84 forks source link

Not possible to set `alt=""` for Avatar #1599

Open ogonkov opened 1 month ago

ogonkov commented 1 month ago

I can't set alt to empty string, because it trying to fallback to title

https://github.com/gravity-ui/uikit/blob/733c5b3bd425ee57d660ed176d15bc99084f6d9a/src/components/Avatar/Avatar.tsx#L43

amje commented 1 month ago

@ogonkov Images with empty strings in alt attribute are not accessible. Why you want it?

ogonkov commented 1 month ago

It has presentation role, this is valid usage

amje commented 1 month ago

It has presentation role, this is valid usage

Has it? We don't allow set this prop

ogonkov commented 1 month ago

Yes. In some cases you don't want to expose image to a11y technologies.

In case of avatar this could be the case when it followed by user name, for example and setting alt text for avatar is obsolete.

amje commented 2 weeks ago

@ogonkov We decided to remove alt prop entirely from the component props