Skip to content

[WNMGDS-3315] Fixed aria-invalid property previously assigned to Dropdown Button #3516

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

Merged
merged 2 commits into from
Apr 4, 2025

Conversation

kim-cmsds
Copy link
Collaborator

Summary

  • Aria recommendations in version 1.2 have changed from applying the aria-invalid value to any kind of element to a specific list of elements based on role (source).
  • The dropdown component (storybook link) had been applying the aria-invalid role to the Dropdown Button, which is no longer a valid element of which to apply that attribute.
  • This PR applies the aria-invalid attribute to the element with the listbox role instead, which is an allowed role for that attribute.
  • Jira ticket
  • Note: this ticket includes steps to reproduce on the production storybook instance, which might help illustrate the issue for reviewers

How to test

  1. Run storybook locally npm run storybook and go to the Dropdown
  2. Inspect the dropdown example's source, and notice how the <button> element no longer has aria-invalid="false"
  3. Close the inspector, and run the Siteimprove browser extension
  4. Ensures that Siteimprove no longer reports the error, "ARIA attribute unsupported or prohibited"

Checklist

  • Prefixed the PR title with the Jira ticket number as [WNMGDS-####] Title or [NO-TICKET] if this is unticketed work.
  • Selected appropriate Type (only one) label for this PR, if it is a breaking change, label should only be Type: Breaking
  • Selected appropriate Impacts, multiple can be selected.
  • Selected appropriate release milestone

If this is a change to code:

  • Created or updated unit tests to cover any new or modified code
  • Verified that running both npm run test:unit and npm run test:browser:all were each successful
  • If necessary, updated unit-test snapshots (npm run test:unit:update) and browser-test snapshots (npm run test:browser:all:update)

@kim-cmsds kim-cmsds added Type: Fixed Indicates an unexpected problem or unintended behavior Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. labels Apr 3, 2025
@kim-cmsds kim-cmsds added this to the 12.1.1 milestone Apr 3, 2025
Copy link
Collaborator

@tamara-corbalt tamara-corbalt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Collaborator

@jack-ryan-nava-pbc jack-ryan-nava-pbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Well done

@kim-cmsds kim-cmsds merged commit 9a9344a into main Apr 4, 2025
1 check passed
@kim-cmsds kim-cmsds deleted the kcn/WNMGDS-3315/fix-dropdown-aria branch April 4, 2025 15:13
jack-ryan-nava-pbc pushed a commit that referenced this pull request Apr 11, 2025
…opdown Button (#3516)

* Apply `aria-invalid` property to element with `listbox` role

* updates unit and browser tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impacts: Core Impacts the core DS primarily, changes may occur in other themes as well. Type: Fixed Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants