Skip to content

fix(a11y): use aria-errormessage for invalid text inputs#21297

Merged
heloiselui merged 9 commits into
carbon-design-system:mainfrom
nehaaprasad:fix/use-aria-error
May 1, 2026
Merged

fix(a11y): use aria-errormessage for invalid text inputs#21297
heloiselui merged 9 commits into
carbon-design-system:mainfrom
nehaaprasad:fix/use-aria-error

Conversation

@nehaaprasad

@nehaaprasad nehaaprasad commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Closes #21247

  • Use aria-errormessage instead of aria-describedby for invalid text inputs and textareas to comply with W3C ARIA specification.

Changelog

Changed

  • Invalid text inputs and textareas now use aria-errormessage for error messages instead of aria-describedby

Testing / Reviewing

  • Verify invalid TextInput/TextArea components have aria-errormessage attribute pointing to error message ID
  • Verify helper text still uses aria-describedby when input is not invalid
  • Test with toHaveAccessibleErrorMessage() assertion in Playwright

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@nehaaprasad nehaaprasad requested a review from a team as a code owner January 16, 2026 05:32
@netlify

netlify Bot commented Jan 16, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 4152935
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69f206649de6910008f58ebc
😎 Deploy Preview https://deploy-preview-21297--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jan 16, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 4152935
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69f20665b666320008e1e4c7
😎 Deploy Preview https://deploy-preview-21297--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jan 16, 2026

Copy link
Copy Markdown

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 32422c5
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/69be0f78e698950008cf5b33
😎 Deploy Preview https://deploy-preview-21297--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jan 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.06%. Comparing base (0ba3f47) to head (4152935).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21297      +/-   ##
==========================================
- Coverage   95.08%   95.06%   -0.02%     
==========================================
  Files         541      541              
  Lines       45217    45217              
  Branches     6560     6560              
==========================================
- Hits        42996    42987       -9     
- Misses       2092     2101       +9     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.14% <100.00%> (+0.01%) ⬆️
web-components 97.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/react/src/components/TextInput/TextInput.tsx Outdated

@adamalston adamalston left a comment

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.

Are there supposed to be test changes to accompany this fix? I'm wondering what the plan is for preventing regressions.

@adamalston

Copy link
Copy Markdown
Contributor

#21874 (review)

Co-authored-by: Sangeetha Babu <sangeetha9223@gmail.com>
Comment thread packages/react/src/components/TextInput/util.ts
@heloiselui heloiselui requested a review from adamalston April 29, 2026 13:24
@heloiselui heloiselui added this pull request to the merge queue May 1, 2026
Merged via the queue into carbon-design-system:main with commit 21677a1 May 1, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[a11y]: Use aria-errormessage for invalid inputs

4 participants