[#524] Improve input element accessibility #576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #524
A new attribute has been added (
aria-labelledby
) in order to combine multiple elements (label
,span
) and have a proper accessible name. This attribute identifies the element (or elements) that labels the element it is applied to. This was tested with Orca screen reader in Ubuntu (super+alt+s
to enable it).References:
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-labelledby
https://www.w3.org/WAI/WCAG22/Techniques/aria/ARIA16 (example 3)
https://help.gnome.org/users/orca/stable/index.html.en
Some remarks:
aria-labelledby
can be used to reference another element to define its accessible name, when an element's accessible name needs to use content from elsewhere in the DOMThe
aria-labelledby
property value can include content from elements that aren't even visible (CSS display: none, and CSS visibility: hidden)