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

Storybook addon-a11y fails with a11y errors about aria-label #4447

Closed
stufreen opened this issue Aug 27, 2021 · 2 comments
Closed

Storybook addon-a11y fails with a11y errors about aria-label #4447

stufreen opened this issue Aug 27, 2021 · 2 comments
Assignees
Labels
Bug Something is broken and not working as intended in the system.

Comments

@stufreen
Copy link

Issue summary

New versions of axe-core (4.2 and later) will treat it as a violation if you have aria-label attribute on generic elements like span. See the Axe changelog and this PR. Polaris does this on the Icon component and maybe others as well.

This is significant because recent versions of @storybook/addon-a11y use axe-core 4.2.0. See @kaelig PR here.

Projects using Polaris and addon-a11y in their CI pipeline will either have to disable this rule or cannot upgrade Storybook.

Expected behavior

The a11y rule linked in the axe-core PR seems valid. Screen readers apparently won't read aria-label for generic elements, so they should be removed.

Actual behavior

Polaris includes aria-label for many generic elements.

Steps to reproduce the problem

  1. Install @storybook/addon-a11y version 6.3.7 and Polaris on the same project
  2. Run storybook
  3. Open accessibility tab for a story that includes one of the affected components (e.g. Icon with accessibilityLabel prop)
  4. A violation will appear relating to the aria-label attribute

Specifications

  • Are you using the React components? (Y/N): Y
  • Polaris version number: 6.5.0
  • Browser: NA
  • Device: NA
  • Operating System: NA
@stufreen stufreen added the Bug Something is broken and not working as intended in the system. label Aug 27, 2021
@ghost
Copy link

ghost commented Aug 27, 2021

👋 Thanks for opening your first issue. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines.

@alex-page alex-page self-assigned this Aug 27, 2021
@BPScott
Copy link
Member

BPScott commented Aug 27, 2021

We updated our own storybook, spotted this issue and fixed this a few days ago in #4414. It'll go out as part of the next release.

@BPScott BPScott closed this as completed Aug 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken and not working as intended in the system.
Projects
None yet
Development

No branches or pull requests

3 participants