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

[Bug]: Accessibility checker incorrectly identifies aria-description as an invalid attribute #22337

Open
Giwayume opened this issue May 1, 2023 · 1 comment

Comments

@Giwayume
Copy link

Giwayume commented May 1, 2023

Describe the bug

The accessibility checker doesn't recognize the aria-description attribute.

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-description

I have verified with NVDA that aria-description works.

To Reproduce

Add aria-description attribute to any HTML element.

image

System

No response

Additional context

No response

@stilt0n
Copy link
Contributor

stilt0n commented Jun 24, 2023

I don't think aria-description has always been supported by axe-core. and the a11y addon seems to be using a fairly old version of axe-core. I tried running storybook init in a new create-react-app project and adding aria-description to one of the example components and it seems to be working fine for me (i.e. it's not considered a violation).

But axe-core is also configurable, and you you can pass configuration to the a11y addon's axe-core in preview.ts. So you should be able to get aria-description recognized, in any case, by following the docs and adding the rule yourself in preview.ts. For example:

const preview = {
  parameters: {
    a11y: {
      config: {
        standards: {
          ariaAttrs: {
            'aria-description': {
              global: true,
            }
          }
        }
      }
    },
    // ... rest of config
};

export default preview;

For my setup this seems to be redundant, but I can cause a violation by setting global: false so the config does seem to be working. There's more docs on axe-core configuration here.

Since this is configurable it's possible it's not really a bug. But it depends on the details of your setup and how it is failing.

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

No branches or pull requests

3 participants