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

UHF-X: Fix unsupported aria-attribute a11y problem #941

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

Arkkimaagi
Copy link
Contributor

@Arkkimaagi Arkkimaagi commented Apr 5, 2024

UHF-X

  • Siteimprove found a problem with our fallback iframe links. Aria-attribute aria-labelledby is not supported on non-interactive elements like span that we're using.
  • We also have some situations where we do not have accessible link text available, and on these cases screen reader get no proper hint what the button does.

Where the problems appear:
image

Example of missing accessible text:
image
Notice how the screen reader sees only the external site text, but not the actual point of the link.

What was done

  • The aria-labelledby was replaced with aria-hidden="true" and class="visually-hidden"-combination
  • An check for the existence of the screenreader only text was added and it now has a fallback mode of regular link text instead of specific screenreader text.

image

How to install

  • Make sure your SOTE instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the HDBT theme
    • composer require drupal/hdbt:dev-UHF-0000_insert_correct_branch
  • Run make drush-cr

How to test

  • Open this page on your local Sote instance
    • Check that screen reader text is rendered like this image
  • Open this page on your local Sote instance
    • Check that the missing screen reader text causes the link to be rendered without it, so that screen readers get a hint what the button does.
      image
  • Check that code follows our standards

Continuous documentation

  • This feature has been documented/the documentation has been updated
  • This change doesn't require updates to the documentation

Copy link

github-actions bot commented Apr 5, 2024

⚠️ Visual regression found! Please check if this change is wanted or accidental. You can check the output here: https://city-of-helsinki.github.io/drupal-hdbt/pull/941/html_report/

Copy link
Contributor

@teroelonen teroelonen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very nice 🦖

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.

2 participants