design-system icon indicating copy to clipboard operation
design-system copied to clipboard

Dropdown button has invalid ARIA attribute (aria-invalid)

Open maggiewachs opened this issue 1 year ago • 0 comments

Describe the bug The dropdown component contains a button with aria-invalid assigned, which is being flagged by our instance of Siteimprove as an invalid use of ARIA. Dropdown source: https://github.com/CMSgov/design-system/blob/main/packages/design-system/src/components/Dropdown/Dropdown.tsx#L279

In previous ARIA recommendations, aria-invalid had a global scope, but the most recent version (1.2), narrowed the scope to specific roles. The aria-invalid attribute should be reassigned to the role="listbox" element.

To Reproduce Steps to reproduce the behavior:

  1. Go to the Dropdown
  2. Inspect the dropdown example's source, and notice how the <button> element has aria-invalid="false"
  3. Close the inspector, and run the Siteimprove browser extension
  4. Siteimprove reports the error, "ARIA attribute unsupported or prohibited", and references aria-invalid on the button

Expected behavior No ARIA violations.

Desktop (please complete the following information):

  • OS: Mac OS 14.6.1
  • Browser: Chrome latest
  • Version: CMS DS v11

maggiewachs avatar Oct 21 '24 14:10 maggiewachs