- Issue created by @herved
- Status changed to Needs review
over 1 year ago 8:04pm 1 August 2023 - π§πͺBelgium herved
Here is the patch with both CSS and markup fixes.
AXE has no issues with that: https://jsfiddle.net/s23w8q4j/ - last update
about 1 year ago 14 pass, 4 fail - last update
about 1 year ago 26 pass - π¬π§United Kingdom Baysaa
Is `sr-only` a native Drupal CSS class? I don't know so asking. I think traditionally `visually-hidden` may be the more appropriate class to use here. So I'd take the patch in the related issue over this one.
- πΊπΈUnited States clarksl@gmail.com
Path #9 worked for me as well. Thanks!
- π©πͺGermany Anybody Porta Westfalica
Thanks, could this please be turned into a MR for further review and merge?
- π¬π§United Kingdom Baysaa
@herved if the icon's using FA then it makes sense that sr-only should also work, thanks!
- Status changed to Needs work
5 months ago 3:06pm 26 June 2024 - πΊπΈUnited States smustgrave
Think visually hidden would be better as even though we have font awesome icons the library might not be present (so the checkbox setting is unchecked) so not sure sr-only would cover all cases.
- Merge request !45Issue #3378557 by herved, smustgrave, baysaa: Fix Font Awesome markup and CSS β (Merged) created by smustgrave
-
smustgrave β
committed b9c5a204 on 2.0.x
Issue #3378557 by herved, smustgrave, baysaa: Fix Font Awesome markup...
-
smustgrave β
committed b9c5a204 on 2.0.x
- πΊπΈUnited States cboyden
I'm testing the latest dev of the 2.0.x branch, including this commit, and it's still outputting aria-label inappropriately.
To reproduce:
- Install Drupal core 10.3.6 using the standard profile.
- Require extlink at 2.0.x-dev via composer.
- Log in as an administrator.
- Enable the extlink module.
- In the extlink settings, check the checkbox for "Use Font Awesome icons instead of images" and save the configuration.
- Rebuild the site cache.
- View the automatically-generated home page content of the standard profile, which includes external links.
- Using the browser code inspector, view the code for the "Drupal community" link:
<a href="https://www.drupal.org/community" class="ext" data-extlink="" rel="noreferrer">Drupal <span class="extlink-nobreak" aria-label="(link is external)">community <span class="fa-ext extlink" role="img" aria-hidden="false"> <i class="fa fa-external-link" data-extlink-placement="append"> </i> <span class="visually-hidden"></span> </span> </span> </a>
First, the aria-label attribute is being output on a nested span tag. The attribute isn't intended for use on elements with a generic role, including the HTML div and span tags. Most assistive technologies will ignore aria-label on generic tags.
Second, the aria-hidden attribute doesn't need to be added if the value is "false." See aria-hidden where the Note says "At the time of this writing, aria-hidden="false" is known to work inconsistently in browsers. As future implementations improve, use caution and test thoroughly before relying on this approach." In the proposed draft for ARIA 1.3, the "false" value is supposed to be handled the same as if it's undefined (i.e. attribute is not present).
Third, the span containing the FA icon markup has a role of "img" and is not hidden from assistive technology, which means it should have something in the way of alt text, but the markup inside that span doesn't contain any text.
- π§πͺBelgium herved
Indeed this doesn't seem valid: https://jsfiddle.net/cafsjowu/1/
It looks like π Prevent extlink icons from breaking into new lines Needs work recently committed added an extra span wrapper in the mean time?
Can you please create a new issue @cboyden? thanksPS: The added code there looks convoluted. I wonder, wouldn't simply
work? - πΊπΈUnited States smustgrave
I'll revert this when I'm back in front of my computer.
-
smustgrave β
committed 6bc2a773 on 2.0.x
Revert "Issue #3378557 by herved, smustgrave, baysaa: Fix Font Awesome...
-
smustgrave β
committed 6bc2a773 on 2.0.x