-
Notifications
You must be signed in to change notification settings - Fork 21
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: Seperate IDs for prefix/suffix and aria-describedby added for suffix (fixes #143) #144
base: master
Are you sure you want to change the base?
Conversation
Could you describe how this reads with the screen readers and why you're using both aria-labelledby https://benmyers.dev/blog/aria-labels-and-descriptions/ It is possible to have more than one id in
|
@oliverfoster when adding both to aria-labelledby the suffix is read out before the content of the textInput (either placeholder or user answer), by adding describedby it reads out the suffix after the content of the text input which seemed like a more logical order. |
Does it do that with all of the screen readers? (nvda, voiceover and jaws in firefox, safari and chrome?) I can't see it defined that way in any of the specs. Do you have a reference we can pin on the pr? |
I've tested with Jaws on Chrome, Firefox and Edge. I shall have a look for a reference. |
@oliverfoster - https://webaim.org/techniques/forms/advanced#describedby "Screen readers will typically read the label, then read the input type (text box, checkbox, etc., plus any necessary properties, such as if the field is required), and then read the description." Whilst this doesn't say 100% will read the description after the input that's the typical behaviour. |
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.
👀
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.
When testing this using VoiceOver on Mac, the placeholder
"Enter answer here" aria-label
isn't read when a prefix is set. Looks like aria-labelledby
replaces aria-label
.
aria-labelledby takes precedence over all other methods of providing an accessible name, including aria-label, , and the element's inner text.
ref: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
I don't have access to test Windows screen readers to see if this is a global issue.
@kirsty-hames I've added the placeholder to the aria-labelledby so it will always be included as aria-describedby doesn't take precedence over aria-label. I've also updated both to reflect the changes made to the slider to remove the attribute by setting it to null when not in use - adaptlearning/adapt-contrib-slider@41976c6 |
Thanks for the updates @joe-allen-89. On retest, the
Note, I've set |
#143
Fix
ref:
https://webaim.org/techniques/forms/advanced#describedby