Skip to content
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

Associate FormControl.Validation with the relevant input #818

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

joshfarrant
Copy link
Contributor

Summary

Adds the FormControl.Validation component's id to the FormControl input's aria-describedby to help assistive tech understand the relationship between the input and the validation message.

List of notable changes:

  • Adds aria-describedby to FormControl input for FormControl.Validation component
  • Adds tests for FormControl.Validation association with the input
  • Adds missing tests for FormControl.Hint association with the input

What should reviewers focus on?

  • Check that you can see the aria-describedby association in the HTML
  • Bonus points for testing with a screen reader

Supporting resources (related issues, external links, etc):

Contributor checklist:

  • All new and existing CI checks pass
  • Tests prove that the feature works and covers both happy and unhappy paths
  • Any drop in coverage, breaking changes or regressions have been documented above
  • UI Changes contain new visual snapshots (generated by adding update snapshots label to the PR)
  • All developer debugging and non-functional logging has been removed
  • Related issues have been referenced in the PR description

Reviewer checklist:

  • Check that pull request and proposed changes adhere to our contribution guidelines and code of conduct
  • Check that tests prove the feature works and covers both happy and unhappy paths
  • Check that there aren't other open Pull Requests for the same update/change

Screenshots:

Please try to provide before and after screenshots or videos

Before After
image image

Copy link

changeset-bot bot commented Nov 14, 2024

🦋 Changeset detected

Latest commit: bbb49b5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@primer/react-brand Patch
@primer/brand-primitives Patch
@primer/brand-e2e Patch
@primer/brand-fonts Patch
@primer/brand-config Patch
@primer/brand-storybook Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no suggestions.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

Copy link
Contributor

github-actions bot commented Nov 14, 2024

🟢 No design token changes found

@joshfarrant joshfarrant force-pushed the joshfarrant/formcontrol-a11y-fixes branch from 04049d7 to f3303c0 Compare November 14, 2024 15:18
@joshfarrant joshfarrant marked this pull request as ready for review November 14, 2024 15:19
Copy link
Contributor

github-actions bot commented Nov 14, 2024

⚠️ Visual differences found

Our visual comparison tests found UI differences.

Please review the differences by using the test artifacts to ensure that the changes were intentional.

Artifacts can be downloaded and reviewed locally.

Download links are available at the bottom of the workflow summary screen.

Example:

artifacts section of workflow run

If the changes are expected, please run npm run test:visual:update-snapshots to replace the previous fixtures.

Review visual differences

Copy link
Collaborator

@rezrah rezrah left a comment

Choose a reason for hiding this comment

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

🙌 nice! thanks @joshfarrant, ship it :shipit:

@joshfarrant joshfarrant merged commit 281beb0 into main Nov 18, 2024
18 checks passed
@joshfarrant joshfarrant deleted the joshfarrant/formcontrol-a11y-fixes branch November 18, 2024 10:56
@primer-css primer-css mentioned this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants