-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(input, textarea): ensure screen readers announce helper and error text when focused #29958
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Confirmed new behavior using VoiceOver 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified this works using Android TalkBack and iOS VoiceOver. 👍
Issue number: internal
What is the current behavior?
Screen readers do not announce helper and error text when user is focused on the input or textarea. This does not align with the accessibility guidelines.
What is the new behavior?
aria
tags are added to the native input and textarea in order to associate them to the helper and error texts.aria-describedBy
will only be added to the native element based on helper or error text. If helper text exists then the helper text ID will be used. If the error text exists and the component has theion-touched ion-invalid
classes, then the error text ID will be used.aria-invalid
will only be added if the error text exists and the component has theion-touched ion-invalid
classes.Does this introduce a breaking change?
Other information
How to test:
main
branchROU-11274
branchmain
branchROU-11274
branchKnown Webkit issues:
This fix will not work on macOS 16 and 17 as VoiceOver will not read any text using
aria-describedby
. Works fine on macOS 18.