Skip to content

fix: Add characterCountText to form field for improved screen reader support#4332

Open
avinashbot wants to merge 3 commits intomainfrom
feat/character-count-text
Open

fix: Add characterCountText to form field for improved screen reader support#4332
avinashbot wants to merge 3 commits intomainfrom
feat/character-count-text

Conversation

@avinashbot
Copy link
Member

@avinashbot avinashbot commented Mar 4, 2026

Description

Apparently, NVDA/JAWS don't fare well when you update the accessible description of an input you're focused on after every keypress, and end up interrupting everything else, like the keypress announcements themselves.

This introduces a new string property, characterCountText, whose updates are debounced for screen readers. This also means that only the updated section of the constraint text ("Character count: x/y") is announced when it changes.

Related links, issue #, if available: AWSUI-61742

How has this been tested?

Added unit tests and a test util method.

Provisioning a Windows machine right now, but I'll also let our accessibility specialists take a crack at it before merging. But in the meantime, the code itself is reviewable.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@avinashbot avinashbot force-pushed the feat/character-count-text branch from 181839c to d0adbdd Compare March 5, 2026 00:54
@avinashbot avinashbot marked this pull request as ready for review March 5, 2026 00:54
@avinashbot avinashbot requested a review from a team as a code owner March 5, 2026 00:54
@avinashbot avinashbot requested review from ernst-dev and removed request for a team March 5, 2026 00:54
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.43%. Comparing base (f7f12ee) to head (d0adbdd).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4332   +/-   ##
=======================================
  Coverage   97.43%   97.43%           
=======================================
  Files         897      897           
  Lines       26342    26357   +15     
  Branches     9517     9522    +5     
=======================================
+ Hits        25667    25682   +15     
  Misses        632      632           
  Partials       43       43           

☔ 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.

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.

1 participant