trussworks / react-uswds

USWDS 3.0 components built in React
https://trussworks.github.io/react-uswds/
Apache License 2.0
169 stars 78 forks source link

[fix] Character counts announced excessively by screen readers #2880

Open jaredcunha opened 3 months ago

jaredcunha commented 3 months ago

ReactUSWDS Version & USWDS Version:

Describe the bug

On pages using the CharacterCount, screen readers announce the character counts even when not interacting with the text area.

To Reproduce Steps to reproduce the behavior:

  1. Turn on VoiceOver
  2. Go to https://trussworks.github.io/react-uswds/?path=/docs/components-charactercount--docs
  3. All the character counts are announced when the page loads
  4. Next, go to https://designsystem.digital.gov/components/character-count/
  5. When the page loads, the character counts are not announced, which is the correct behavior.

It could be possible that the live regions are announced so often is because of how javascript applications refresh content when the state updates. This isn't happening in USWDS source component because it is used on a static HTML page.

Expected behavior

Character counts should only be announced when interacting with the text area

Screenshots

Additional context

Device and Browser Information (please complete the following information if describing a UI bug):