Skip to content

role-suports-aria-props is not flagging prohibited accessible name usage on generic elements #910

Open
@khiga8

Description

@khiga8

I would expect role-suports-aria-props to flag prohibited accessible name usage on generic elements like:

<div aria-label="Some label">
<span aria-label="Some label">
<div aria-labelledby="some-id">
<span aria-labelledby="some-id">

etc.

We see this misuse of accessible name a lot in our projects and we're hoping this is a case we can cover with eslint-plugin-jsx-a11y.

I'd hoped that the latest bump of aria-query in #814 would start flagging these issues, but when I update the tests in tests/src/rules/role-supports-aria-props-test.js on the latest main to include invalid cases like:

    {
      code: '<div aria-label />',
      errors: [errorMessage('aria-label', 'generic', 'div', true)],
    },

it doesn't seem like it's being recognized as invalid.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions