Skip to content

docs: Reformat TextArea Accessibility - #4058

Draft
moaan-workday wants to merge 9 commits into
Workday:a11yfrom
moaan-workday:text-area-reformat
Draft

docs: Reformat TextArea Accessibility#4058
moaan-workday wants to merge 9 commits into
Workday:a11yfrom
moaan-workday:text-area-reformat

Conversation

@moaan-workday

@moaan-workday moaan-workday commented Jul 10, 2026

Copy link
Copy Markdown

Summary

This PR rewrites the TextArea Storybook accessibility section to match the newer AI-codegen documentation template (the same pattern used for Dialog and FormField). It turns a short paragraph into a comprehensive accessibility guide.

  • Documents the generated ID convention: label-{id}, input-{id}, hint-{id}.
  • Clarifies that FormField.Input wires aria-labelledby, aria-describedby, aria-invalid, and required automatically.
  • Notes that error="caution" is visual-only and does not set aria-invalid.
  • Warns that FormField.Input always sets aria-describedby="hint-{id}" when an id exists, so omitting FormField.Hint creates a dangling reference.
  • Provides a debounced AriaLiveRegion example for character counts and links to the existing guide.
  • Adds a requirements table covering visible labels, wiring, hints/errors, required/disabled states, character limits, placeholders, stable IDs, and resize constraints.

Release Category

Documentation

Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

Thank You Gif (optional)

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 36a310fe-edf7-458f-b202-8a8447c62edc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@moaan-workday moaan-workday changed the title Text area reformat docs: text area a11y reformat Jul 10, 2026
@moaan-workday moaan-workday changed the title docs: text area a11y reformat docs: Reformat TextArea Accessibility Jul 10, 2026
Comment thread modules/react/text-area/stories/TextArea.mdx
Comment thread modules/react/text-area/stories/TextArea.mdx
Comment thread modules/react/text-area/stories/TextArea.mdx Outdated
@cypress

cypress Bot commented Jul 27, 2026

Copy link
Copy Markdown

Workday/canvas-kit    Run #11456

Run Properties:  status check passed Passed #11456  •  git commit 91390af3f4 ℹ️: Merge e35064fe24b66e60b9d0890903f57c6fa3021d57 into 1043c2ab55c5a6e4ceb9343e29be...
Project Workday/canvas-kit
Branch Review text-area-reformat
Run status status check passed Passed #11456
Run duration 02m 27s
Commit git commit 91390af3f4 ℹ️: Merge e35064fe24b66e60b9d0890903f57c6fa3021d57 into 1043c2ab55c5a6e4ceb9343e29be...
Committer moaan-workday
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 17
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 809
View all changes introduced in this branch ↗︎
UI Coverage  19.52%
  Untested elements 1540  
  Tested elements 371  
Accessibility  99.44%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 68  

Co-authored-by: Cursor <cursoragent@cursor.com>

@williamjstanton williamjstanton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Putting in some feedback of my own to help move this along. I think we have a couple of big questions to work through:

  1. Should we be focusing on React TSX code, or DOM renders for AI code-gen? What's more deterministic?
  2. How do we avoid duplicating docs? How are we splitting concerns between what TextArea does and what FormField is doing?

```html
<div>
<label id="label-abc" for="input-abc">Leave a Review</label>
<textarea id="input-abc" aria-labelledby="label-abc"></textarea>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

DOM example contradicts your own implementation note
You document that FormField.Input always sets aria-describedby="hint-{id}", but the first HTML sample has no aria-describedby. Dialog never shows a simplified DOM that contradicts built-ins. For codegen, that first snippet will win over the prose. Either show the always-on attribute (and a missing #hint-abc as the bug case), or drop the “simple” example.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Attempted fix in commit:
docs(text-area): Show aria-describedby in simple DOM example without hint
26fc83469

- Help text and error messages (via `aria-describedby`).
- The current value or "blank" if empty.
- That it's a multi-line text input field.
| Requirement | How to satisfy |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Too much FormField, not enough TextArea
Dialog points at FormField for labeled inputs in one row; it doesn’t re-spec FormField’s whole table. Your requirements table (label, hint, error, caution, required, stable IDs) largely duplicates FormField Accessibility. Dialog’s benchmark is: own what’s unique, link what’s shared. TextArea-unique rows should dominate: multi-line choice, resize, native <textarea> semantics, etc.

@purvas12 purvas12 Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree. I would recommend keeping Input wiring with a reference link to form field docs, character limit as those are the only ones specific to text area.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Attempted a fix in following commit. How does it look now?
docs(text-area): Remove excessive formfield mention in the accessibility requirement and how to satisfy table

e35064fe2

Comment thread modules/react/text-area/stories/TextArea.mdx
- Set **`error`** on **`FormField`**, not on `TextArea` directly, so `aria-invalid` and error
styling stay in sync.

**Keyboard** (_standard multi-line text control behavior_):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Most of your keyboard bullets are native <textarea> / behavior. Keep a short “native multi-line control” note; spend the budget on anything Canvas Kit changes.

I'm concerned we might be using up too much context re-iterating native behaviors?

- **User-resizable dimensions**: Defaults to `resize: both` so users can adjust the control for
visual comfort.

**Implementation notes**:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think I've seen this implementation notes section before in our other drafts.

All of the bullet points either duplicate what's in FormField, or duplicate anti-patterns below.

IMO, we should consider removing this set of bullets altogether.

| Character limit _(conditional)_ | `maxLength` on **`FormField.Input`**, visible count in **`FormField.Hint`**, and debounced **`AriaLiveRegion`** for screen reader updates |
| Placeholder _(conditional)_ | Short format example on **`FormField.Input`** only—never as the sole label |
| Stable IDs _(conditional)_ | `id` prop on **`FormField`** when predictable `label-`, `input-`, and `hint-` IDs are needed for testing |
| Resize constraints _(conditional)_ | `resize` prop on **`TextArea`**; default to `Both` unless layout requires otherwise |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Referring to my other comment, I think we should remove this since it is just a CSS property.

| Disabled field _(conditional)_ | `disabled` on **`FormField.Input`** (passed through to `<textarea>`) |
| Character limit _(conditional)_ | `maxLength` on **`FormField.Input`**, visible count in **`FormField.Hint`**, and debounced **`AriaLiveRegion`** for screen reader updates |
| Placeholder _(conditional)_ | Short format example on **`FormField.Input`** only—never as the sole label |
| Stable IDs _(conditional)_ | `id` prop on **`FormField`** when predictable `label-`, `input-`, and `hint-` IDs are needed for testing |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't understand why stable ID's are listed here as conditional requirements. IMO, I think we should remove.

@williamjstanton
williamjstanton requested a review from purvas12 July 29, 2026 14:55
- Help text and error messages (via `aria-describedby`).
- The current value or "blank" if empty.
- That it's a multi-line text input field.
| Requirement | How to satisfy |

@purvas12 purvas12 Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree. I would recommend keeping Input wiring with a reference link to form field docs, character limit as those are the only ones specific to text area.

Comment thread modules/react/text-area/stories/TextArea.mdx
Comment thread modules/react/text-area/stories/TextArea.mdx
Comment thread modules/react/text-area/stories/TextArea.mdx
Comment thread modules/react/text-area/stories/TextArea.mdx
- **CONDITIONAL:** hint/error text, required state, disabled state, character limit with live
region, placeholder, stable `id`, resize constraints

### Anti-Patterns

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's trim this section down as well. Only keep the ones that are unique to Text area: Single-line input for multi-line content, Per-keystroke character announcements and Disabling resize unnecessarily. Add a reference to the Anti-patterns section for Form Field to avoid duplicating content.

Comment thread modules/react/text-area/stories/TextArea.mdx
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.

4 participants