Skip to content

fix(ConnectedFormGroup): Have screen reader read form input error#3098

Merged
codecademydev merged 1 commit intomainfrom
jrood.COPS-194
Jun 10, 2025
Merged

fix(ConnectedFormGroup): Have screen reader read form input error#3098
codecademydev merged 1 commit intomainfrom
jrood.COPS-194

Conversation

@jrood
Copy link
Copy Markdown
Collaborator

@jrood jrood commented Jun 2, 2025

Overview

Link the error to the form input via aria-describedby

PR Checklist

  • Related to designs:
  • Related to JIRA ticket: COPS-194
  • I have run this code to verify it works
  • This PR includes unit tests for the code change
  • This PR includes testing instructions tests for the code change
  • The alpha package of this PR is passing end-to-end tests in all relevant Codecademy repositories

Testing Instructions

  1. Go to Organisms > ConnectedForm -> ConnectedForm > Docs
  2. Go to the Playground
  3. Submit the form. This should cause errors to appear on the inputs.
  4. Use VoiceOver to navigate through the form
  5. When you navigate to the input field, listen for it to read the error.
  6. If it successfully reads the error, do a celebratory dance.

If you prefer to test within the portal-app preview env, the same test can be done using First name and Last name fields on the logged in checkout page. Login first, then navigate to https://tengu.codecademy.com/checkout?plan_type=directpurchase&PR_ENV=portal-app-pr-10427

PR Links and Envs

Repository PR Link
Monolith Monolith PR
Mono Mono PR

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Jun 2, 2025

View your CI Pipeline Execution ↗ for commit 497ef54.


☁️ Nx Cloud last updated this comment at 2025-06-10 19:25:25 UTC

@jrood jrood changed the title Have screen reader read form input error fix: Have screen reader read form input error Jun 2, 2025
@jrood jrood force-pushed the jrood.COPS-194 branch 4 times, most recently from e5e9fda to b4f3cb6 Compare June 9, 2025 19:11
@jrood jrood marked this pull request as ready for review June 9, 2025 19:27
@jrood jrood requested a review from a team as a code owner June 9, 2025 19:27
@dreamwasp dreamwasp changed the title fix: Have screen reader read form input error fix(ConnectedFormGroup): Have screen reader read form input error Jun 10, 2025
Copy link
Copy Markdown
Contributor

@LinKCoding LinKCoding left a comment

Choose a reason for hiding this comment

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

Checked on VO and it sounds great! There's much more info than before :)

We can also take this offline, another thought — @dreamwasp was also curious if there was any follow up tix for other ConnectedFormGroup fields?
E.g. I noticed that the radiogroup didn't read out its error.
and the recurly field for credit cards (which I know you only mentioned the First + Last name in this PR, but did make me curious)

Otherwise, the gamut team can also cut some follow-up tix.
Thanks!

);

const textError = customError || getErrorMessage(error);
const showError = !!((error || customError) && !hideLabel);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thought on subbing out (error || customError) to just textError?
The getErrorMessage seems to return a truthy value if there is an error

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

ah, yep good call!

@codecademydev
Copy link
Copy Markdown
Collaborator

📬Published Alpha Packages:

@codecademy/gamut@64.1.1-alpha.497ef5.0
@codecademy/gamut-kit@0.6.514-alpha.497ef5.0

@codecademydev
Copy link
Copy Markdown
Collaborator

🚀 Styleguide deploy preview ready!

https://684886b42845671ba0d9fba5--gamut-preview.netlify.app

Deploy Logs

@jrood jrood added the Ship It :shipit: Ready 2 ship label Jun 10, 2025
@codecademydev codecademydev merged commit 5d86b54 into main Jun 10, 2025
21 of 22 checks passed
@codecademydev codecademydev removed the Ship It :shipit: Ready 2 ship label Jun 10, 2025
@codecademydev codecademydev deleted the jrood.COPS-194 branch June 10, 2025 19:56
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.

3 participants