Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem:
ChromeVox reads a bunch of gibberish for the mobile search link magnifying glass icon.
level A WCAG failure, SC 1.1.1 non text content
resolution:
provide a text alternative for the icon, make sure it's translatable
Use something like this:
<a href="/search">
<span class="search-icon" aria-hidden="true"></span>
<span class="visually-hidden">Search</pan>
</a>
Comment | File | Size | Author |
---|---|---|---|
#6 | interdiff_2942496-2-6.txt | 830 bytes | Eli-T |
#6 | 2942406_6_fix_pan.patch | 879 bytes | Eli-T |
#2 | 2942406-2.patch | 878 bytes | markconroy |
Comments
Comment #2
markconroy CreditAttribution: markconroy at Annertech commentedHi Andrew,
I'm not sure if I have the reworked html from the search block twig file correct, but here's a first attempt at a patch. I put the icon svg inside the span that has the aria-hidden attribute.
Comment #3
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedThat's the right approach. I'm reading the patch on a phone, will try it tomorrow, should only takes a few minutes.
Comment #4
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedPerfect. Tested the patch, inspected the markup, tried it in a screen reader.
Comment #5
alexpott/pan? I guess the browser was doing something clever and auto-fixing the html.
Comment #6
Eli-TFix incorrect closing tag noted in #5
Comment #7
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedGood catch. I compared both patches. When you view the HTML in firefox dev tools, it shows a closing /span and that mistake isn't clear.
Comment #8
alexpottCommitted 3c43071 and pushed to 8.6.x. Thanks!