Skip to content
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

[#524] Improve input element accessibility #576

Merged

Conversation

vaszig
Copy link
Contributor

@vaszig vaszig commented Oct 27, 2023

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 DOM

  • The aria-labelledby property value can include content from elements that aren't even visible (CSS display: none, and CSS visibility: hidden)

@vaszig vaszig force-pushed the of-524/fix-input-accessibility-concerning-suffix branch from 2d7a6c2 to bd1f607 Compare October 27, 2023 13:20
@vaszig vaszig changed the title [OF#524] Improve input element accessibility [#524] Improve input element accessibility Oct 27, 2023
@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (418efd4) 55.59% compared to head (af510ed) 71.22%.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #576       +/-   ##
===========================================
+ Coverage   55.59%   71.22%   +15.63%     
===========================================
  Files         205      209        +4     
  Lines        3745     4282      +537     
  Branches      682     1159      +477     
===========================================
+ Hits         2082     3050      +968     
+ Misses       1471     1199      -272     
+ Partials      192       33      -159     

see 133 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vaszig vaszig force-pushed the of-524/fix-input-accessibility-concerning-suffix branch from bd1f607 to 416d467 Compare October 27, 2023 14:47
Attribute aria-labelledby is added in order to reference multiple
elements on the page and define the final accessible name for the input
element.
@vaszig vaszig force-pushed the of-524/fix-input-accessibility-concerning-suffix branch from 069e484 to af510ed Compare October 31, 2023 07:52
@sergei-maertens sergei-maertens merged commit 9feb83b into main Oct 31, 2023
12 checks passed
@sergei-maertens sergei-maertens deleted the of-524/fix-input-accessibility-concerning-suffix branch October 31, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Input affixes: improve accessibility
2 participants