Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avatar accessibility #12

Merged
merged 1 commit into from
Jun 13, 2019
Merged

fix: Avatar accessibility #12

merged 1 commit into from
Jun 13, 2019

Conversation

jsomsanith-tlnd
Copy link
Contributor

@jsomsanith-tlnd jsomsanith-tlnd commented Jun 13, 2019

What is the problem this PR is trying to solve?
Avatar component is not accessible

non-a11y

(SR = Screen Reader)

  1. The loading avatar is just skipped by SR (yeah I added a "lol" text on the left to show that the focus switch between the elements between the loading avatar, it's kind of my default text when I don't know what to write :D )
    A loader should have aria-busy attribute and a text alternative if it doesn't contains explicit text.

  2. The initial avatar alt attribute is not taken into account by SR, it reads only the initial letter

What is the chosen solution to this problem?

  1. Set the aria-busy attribute and a Loading avatar ... aria-label

  2. Hide the initial with aria-hidden, and set the username in an aria-label instead of alt attribute

a11y

@domyen
Copy link
Member

domyen commented Jun 13, 2019

Thank you! This is awesome 🙇

@domyen domyen merged commit c4341e8 into storybookjs:master Jun 13, 2019
@kylesuss
Copy link
Collaborator

🚀 PR was released in v0.0.23 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants