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

Bug: Pseudo icons accessibility attributes missing when using SVJ + JS solution #20496

Open
2 tasks done
shaundona-design opened this issue Dec 9, 2024 · 2 comments
Open
2 tasks done
Labels
bug needs-triage This bug needs to be confirmed

Comments

@shaundona-design
Copy link

shaundona-design commented Dec 9, 2024

### Bug description

SVG + JS pseudo element used as described by docs. Role of img applied when fontawesome switches out for svg icon but attributes missing aria-hidden="true" & focusable="false". This flags as an issue when testing for accessibility. Flagged as impact: Serious.

Reproducible test case

No response

<svg data-fa-pseudo-element="::after" data-prefix="fas" data-icon="f08e" class="svg-inline--fa fa-f08e" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"></path></svg>

Screenshots

No response

Font Awesome version

v6.7.1

Serving

Font Awesome CDN

Implementation

SVG+JS

Browser and Operating System

  • Chrome Version 129.0.6668.101 Mac OS 15.1.1

Web bug report checklist

  • I have included a test case because my odds go way up that the team can fix this when I do
  • I have searched for existing issues and to the best of my knowledge this is not a duplicate
@shaundona-design shaundona-design added bug needs-triage This bug needs to be confirmed labels Dec 9, 2024
@shaundona-design shaundona-design changed the title Bug: Pseudo accessibility attributes missing Bug: Pseudo icons accessibility attributes missing Dec 10, 2024
@shaundona-design shaundona-design changed the title Bug: Pseudo icons accessibility attributes missing Bug: Pseudo icons accessibility attributes missing when using SVJ + JS solution Dec 10, 2024
@RoelN
Copy link

RoelN commented Dec 20, 2024

Thanks @shaundona-design for letting us know about the issue. Are you using a Kit or hosting Font Awesome locally in your project? Did you perhaps turn off Auto Accessibility?

We will soon release an update that will set aria-hidden="true" for icons without an explicit aria-label. We won't add the focusable="true" as that is an attribute from the SVG Tiny 1.2 spec, and aria-hidden will prevent focus. You can always manually add a tabindex if you want to explicitly enable or disable focus regardless.

Let me know if this helps solving the issue!

@shaundona-design
Copy link
Author

Hi @RoelN we are using a kit (Font Awesome CDN ). Keen to keep the auto accessibility feature switch on. Not needing focus to be set to true, as we don't require the icons to be picked up by the screen reader. Look forward to testing once you have released an update and appreciate you folks addressing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage This bug needs to be confirmed
Projects
None yet
Development

No branches or pull requests

2 participants