dozoisch / react-google-recaptcha

Component wrapper for Google reCAPTCHA
MIT License
1.04k stars 145 forks source link

Error messages are not announced for screen readers #297

Open dominoweir opened 1 month ago

dominoweir commented 1 month ago

react-google-recaptcha version: 3.1.0 react-async-script version: unclear, I don't see it in our lockfile as a dep

The status of the checkbox for recaptcha is announced correctly with a screen reader turned on but the expiration message is not. This is confusing for screen reader users, and could probably fixed by turning the DOM element for the error message into a live region (MDN docs).

To reproduce:

  1. Turn on your device's screen reader (Cmd+F5 on my Mac to turn on VoiceOver)
  2. Load any page or component that contains a recaptcha
  3. Check the recaptcha text box and note that it is announced as checked by the screen reader
  4. Wait one minute for the recaptcha to expire until the error message pops up
  5. Note that the error message is not announced
Emmanuel-222 commented 1 month ago

Please assign this to me.

dominoweir commented 1 month ago

@Emmanuel-222 I don't think I have powers to assign since I'm not a project owner.