design-system
design-system copied to clipboard
Dropdown button has invalid ARIA attribute (aria-invalid)
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:
- Go to the Dropdown
- Inspect the dropdown example's source, and notice how the
<button>element hasaria-invalid="false" - Close the inspector, and run the Siteimprove browser extension
- Siteimprove reports the error, "ARIA attribute unsupported or prohibited", and references
aria-invalidon 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