feat(a11y): input and form-control accessibility - #1646
Conversation
0451104 to
2d38c44
Compare
2d38c44 to
4d6fabc
Compare
Review SummaryPR: #1646 - feat(a11y): input and form-control accessibility Findings
No blocking issues. The form accessibility improvements follow ARIA best practices for input labeling and error association. |
| <div className="relative w-1/3"> | ||
| <select | ||
| id="ctp-identifier-type" | ||
| ariaLabel="Identifier type" |
There was a problem hiding this comment.
some ariaLabels have locale supports, some don't have.
It's better to add for all.
| @@ -0,0 +1,21 @@ | |||
| let visuallyHiddenClass = "!absolute !-m-px !h-px !w-px !overflow-hidden !whitespace-nowrap !border-0 !p-0 ![clip:rect(0,0,0,0)]" | |||
There was a problem hiding this comment.
clip is deprecated
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/clip
| expiryError->String.length > 0)}> | ||
| <div | ||
| <LiveError | ||
| text="Invalid input" |
There was a problem hiding this comment.
add locale support for it
6eded61 to
91345ec
Compare
91345ec to
ab7307b
Compare
Add ARIA semantics across all text inputs and selects; required state wired from fieldConfig.isRequired; ARIA on bypassing selects/inputs. Localization: accessibility locale dictionary scaffold + the keys used here (cardNetworkLabel, morePaymentMethodsLabel, yearLabel, monthLabel, optionTabLabel). Reuse: shared LiveError component for announced errors.
ab7307b to
cc05cab
Compare
|
Please check card form in compressed layout as well once |
Type of Change
Description
This PR improves the accessibility contract for payment form controls. It makes control names concise, ensures required and invalid states match the visible validation state, and keeps error messages programmatically associated with the control that needs attention.
It also introduces reusable accessibility helpers for repeated label fallback, optional error detection, visually hidden text, and invalid-state mapping, so later PRs can use the same behavior consistently instead of repeating local logic.
This is the first PR in the split accessibility stack and should be reviewed first. Later PRs build on these shared form-control semantics.
Closes #1645
How did you test it?
Validated as part of the completed accessibility stack. The checks cover the combined flow after all stacked PRs are applied, and the form-control behavior was also checked through the local payment-element accessibility smoke flow.
npm run re:buildon the completed accessibility stack.npm run test:hookson the completed accessibility stack.npm run buildon the completed accessibility stack.Checklist
npm run re:build