Skip to content

Critical accessibility issues: aria roles and aria-label #3355

@geoffrich

Description

@geoffrich

When running the Axe accessibility tester against the react-select v2 code-sandbox, two critical issues are identified:

  • Form elements must have labels. While you can pass aria-label as a prop to the Select component, it is not assigned as an attribute to the #react-select-2-input HTML element. Adding this attribute satisfies the Axe tester.
  • Certain ARIA roles must be contained by particular parents. Each .select__option has role="option"; however, the parent div .select__menu-list does not have role="listbox". Adding this attribute satisfies the Axe tester. Note that I had to use React Developer Tools to set menuIsOpen on the StateManager to see this violation.

Below are screenshots of the Axe test results.
Form elements must have labels

Certain ARIA roles must be contained by particular parents

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/accessibilityIssues or PRs related to accessibilityissue/reviewedIssue has recently been reviewed (mid-2020)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions