The Toolbar search element added through this module is not accessible, and generates an error through automated scanning.
The issue (identified with the pa11y-ci scanner):
• This form field should be labelled in some way. Use the label element (either with a "for" attribute or wrapped around the form field), or "title",
"aria-label" or "aria-labelledby" attributes as appropriate.
(#admin-toolbar-search-input)
<input id="admin-toolbar-search-input" type="text" size="60" maxlength="128" class="form-text ui-autocomplete-input" autocomplete="off">
The attached patch addresses the issue by adding an aria-label attribute, which works for our use case; however, this will not work for mulit-lingual sites. A better implementation would be the use of a 'Label" element associated with the input field through the use of a "for" attribute, which can then have the label run through Drupal's i18n translator.
Comment | File | Size | Author |
---|---|---|---|
#4 | admin-toolbar-search-aria-label-3062148-4.patch | 408 bytes | oknate |
| |||
#2 | accessibility-admin-toolbar-search-element-is-not-accessible-3062148-1-D8.patch | 375 bytes | lhridley |
|
Comments
Comment #2
lhridley CreditAttribution: lhridley at Promet Source commentedComment #3
lhridley CreditAttribution: lhridley at Promet Source commentedComment #4
oknateWhat about using aria-labelledby?
Comment #5
adriancidComment #6
adriancid@lhridley I think the @oknate solution is better can you check if this will work on your case?
Comment #7
lhridley CreditAttribution: lhridley at Promet Source commented@adriancid I can confirm that @oknate 's solution in #4 works as well. It's a better solution than the one I submitted. We have applied this patch to our project.
Thank you, @adriancid and @oknate!
Comment #9
adriancidthanks ;-)
Comment #11
oknateGreat, thanks for testing, @lhridley and thanks for committing, @adriancid!