-
Notifications
You must be signed in to change notification settings - Fork 244
docs: Migrating accessibility guidelines for FormFIeld, TextInput, TextArea #3615
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
base: master
Are you sure you want to change the base?
docs: Migrating accessibility guidelines for FormFIeld, TextInput, TextArea #3615
Conversation
Reducing redundancy in the Error & Caution docs. Making FormField the single source of truth.
Discovering we can't use 'as={InputGroup}' on 'FormField.Input' component because it breaks assumptions about which elements to apply input id value for the label.
Workday/canvas-kit
|
||||||||||||||||||||||||||||||||||||||||
| Project |
Workday/canvas-kit
|
| Branch Review |
william-docs-form-fields
|
| Run status |
|
| Run duration | 02m 25s |
| Commit |
|
| Committer | William Stanton |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
1
|
|
|
86
|
|
|
0
|
|
|
850
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
19.36%
|
|
|---|---|
|
|
1539
|
|
|
367
|
Accessibility
99.33%
|
|
|---|---|
|
|
6 critical
5 serious
0 moderate
2 minor
|
|
|
77
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates accessibility guidelines for FormField, TextInput, and TextArea components from the design site into the Canvas repository as technical documentation for developers. The changes consolidate error state examples into FormField, fix critical InputGroup label association issues, and add a new debounced AriaLiveRegion example for character count announcements.
- Reorganized error/caution state documentation to FormField with improved accessibility guidance and "Error:"/"Alert:" prefixes for colorblind users
- Fixed InputGroup label associations by using
useFormFieldModeland hoisting input IDs for proper ARIA labeling - Added comprehensive accessibility sections covering autocomplete, mobile keyboards, screen reader experiences, label associations, and character limit best practices
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/react/text-input/stories/examples/Icons.tsx | Fixed InputGroup label association by hoisting FormField input ID and rendering InputGroup on FormField.Field |
| modules/react/text-input/stories/examples/Error.tsx | Removed - consolidated into FormField error state documentation |
| modules/react/text-input/stories/examples/Caution.tsx | Removed - consolidated into FormField caution state documentation |
| modules/react/text-input/stories/TextInput.stories.ts | Removed Caution and Error story exports |
| modules/react/text-input/stories/TextInput.mdx | Added comprehensive accessibility section with autocomplete, input types, placeholders, and screen reader guidance |
| modules/react/text-area/stories/examples/Error.tsx | Removed - consolidated into FormField error state documentation |
| modules/react/text-area/stories/examples/Caution.tsx | Removed - consolidated into FormField caution state documentation |
| modules/react/text-area/stories/TextArea.stories.ts | Removed Caution and Error story exports |
| modules/react/text-area/stories/TextArea.mdx | Added accessibility section with character limits, resize constraints, and screen reader guidance |
| modules/react/form-field/stories/examples/HiddenLabel.tsx | Fixed InputGroup label association using same pattern as Icons.tsx |
| modules/react/form-field/stories/examples/GroupedInputs.tsx | Added "Error:" prefix to error messages for colorblind users |
| modules/react/form-field/stories/examples/Error.tsx | Added "Error:" prefix to hint text for better accessibility |
| modules/react/form-field/stories/examples/Caution.tsx | Updated example with "Alert:" prefix and better password strength messaging |
| modules/react/form-field/stories/FormField.mdx | Reorganized accessibility section, added guidance on error prefixes, disabled fields, required fields, and label best practices |
| modules/docs/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.tsx | New example demonstrating debounced live region announcements for character limits |
| modules/docs/mdx/accessibility/TestingTableWithFormFields.mdx | New documentation for testing tables with form field components |
| modules/docs/mdx/accessibility/AriaLiveRegions.mdx | Replaced TextInputWithLiveError example with debounced character limit example |
| cypress/component/TextInput.spec.tsx | Removed Caution and Error test cases, simplified to test only Basic example |
| cypress/component/TextArea.spec.tsx | Removed Caution and Error test cases, simplified to test only Basic example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
modules/docs/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
Summary
As part of making accessibility a "first class citizen" in Canvas docs, we will be pulling any technical information for developers off of the design site, and into the Canvas repository.
FormField, TextInput, and TextArea are my next focus.
Release Category
Documentation
Checklist
ready for reviewhas been added to PRFor the Reviewer
Where Should the Reviewer Start?
modules/react/form-field/stories/FormField.mdxmodules/react/text-input/stories/TextInput.mdxmodules/react/text-area/stories/TextArea.mdxImportant notes about using
InputGroup:modules/react/text-input/stories/examples/Icons.tsxmodules/react/form-field/stories/examples/HiddenLabel.tsxA really cool new example debouncing an AriaLiveRegion:
modules/docs/mdx/accessibility/AriaLiveRegions.mdxmodules/docs/mdx/accessibility/examples/AriaLiveRegions/CommentBoxWithCharLimit.tsxAreas for Feedback? (optional)
Testing Manually
Screenshots or GIFs (if applicable)
For the InputGroup examples, make sure the text input fields are properly associated to their label elements. (Previously, the
idattribute values were incorrectly being set on theInputGroupcontainer element.)Thank You Gif (optional)