Skip to content

fix(DatePicker): link invalid/warn text via aria-describedby#22070

Merged
tay1orjones merged 2 commits into
carbon-design-system:mainfrom
heloiselui:21986-fix-datepicker-validation-a11y
Apr 22, 2026
Merged

fix(DatePicker): link invalid/warn text via aria-describedby#22070
tay1orjones merged 2 commits into
carbon-design-system:mainfrom
heloiselui:21986-fix-datepicker-validation-a11y

Conversation

@heloiselui

Copy link
Copy Markdown
Contributor

Closes #21986

Fixed DatePickerInput a11y so invalid/warn messages are announced by screen readers (aria-describedby + aria-invalid).

Changelog

New

  • None.

Changed

  • Updated DatePickerInput accessibility wiring so aria-describedby points to:
    • invalid text when invalid
    • warning text when warn
    • helper text otherwise
  • Added aria-invalid="true" when DatePickerInput is invalid
  • Added tests for helper/invalid/warn accessibility behavior

Removed

  • None.

Testing / Reviewing

  • Go to React Deploy Preview > DatePicker > Default
  • Turn on VoiceOver
  • Set invalid or warn to true and add invalidText or warnText in Storybook controls
  • Confirm VoiceOver announces the invalid or warn message

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

@heloiselui heloiselui requested a review from a team as a code owner April 20, 2026 15:21
@netlify

netlify Bot commented Apr 20, 2026

Copy link
Copy Markdown

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit d0acac8
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69e64472e46d630008d411b2
😎 Deploy Preview https://deploy-preview-22070--v11-carbon-react.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.

@netlify

netlify Bot commented Apr 20, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit d0acac8
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69e64472ed474c000809b09a
😎 Deploy Preview https://deploy-preview-22070--v11-carbon-web-components.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 Apr 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.01%. Comparing base (efcbaa2) to head (d0acac8).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #22070      +/-   ##
==========================================
+ Coverage   94.99%   95.01%   +0.01%     
==========================================
  Files         538      538              
  Lines       44970    44976       +6     
  Branches     6483     6458      -25     
==========================================
+ Hits        42721    42732      +11     
+ Misses       2120     2115       -5     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.07% <100.00%> (+0.03%) ⬆️
web-components 97.83% <ø> (ø)

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.

@maradwan26 maradwan26 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.

LGTM !

@tay1orjones tay1orjones added this pull request to the merge queue Apr 22, 2026
Merged via the queue into carbon-design-system:main with commit ffd8d30 Apr 22, 2026
39 checks passed
@heloiselui heloiselui deleted the 21986-fix-datepicker-validation-a11y branch April 22, 2026 15:21
@carbon-automation

Copy link
Copy Markdown
Contributor

Hey there! v11.106.0 was just released that references this issue/PR.

MarianaAa01 pushed a commit to MarianaAa01/carbon that referenced this pull request May 29, 2026
…design-system#22070)

* fix(DatePicker): link invalid/warn text via aria-describedby

* test(DatePicker): add a11y test for helper/invalid/warn messaging
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]: Screen reader not announcing Error messages in DatePicker component

3 participants