Greetings,
Our University has prioritized making our sites WCAG 2.0 compliant. In the course of an "Accessibility Audit" of our Drupal sites, the Accordions built using FAQ Field were dinged for:
- expanded/collapsed state of accordian not expressed by assistive technology
- a ccordions use tabpanel, tab list and tab roles for non-tabbed-control behavior.
Having just taken a great online course in Web Accessibility for Developers, I saw an opportunity to apply an example given there with this module to improve the screen readers' user experience.
The example created an accordion using a definition list and some Javascript. So I used the "render as definition list" option and added the associated scripts.
If nothing else, having this patch (coming) here will help us if the module gets updated down the road. But maybe the maintainers would be interested in using this approach, or something similar, in order to improve the accessibility of the accordions…
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | faqfield-fully_accessible_accordions-3011774-6.patch | 13.83 KB | byronveale |
| #5 | interdiff.txt | 7.8 KB | bkosborne |
| #5 | faqfield-fully_accessible_accordions-3011774-5.patch | 13.12 KB | bkosborne |
Comments
Comment #2
byronveale commentedAnd here is the patch (attached)
Comment #3
byronveale commentedOkay, had to fix some missteps I made when using the jQuery noConflict() method…
Comment #4
byronveale commentedMore missteps, fingers crossed third time's the charm…
Comment #5
bkosborne+1 for this
Byron,
I reviewed this and updated a few things to align with Drupal's best practices for JS. I attached a new patch with my changes, and an interdiff that contains just the changes from your original.
Aside from that, I think a few other things could be changed to make it a better candidate to be committed to the module:
Comment #6
byronveale commentedThanks Brian!
Yes, would like to integrate this properly, likely by rewriting the current "Accordion" option to use this updated/scripted definition list option, then reverting the definition list option to it's original form. And yes, would like to also take advantage of the multi-/single-select functionality in the script with a settings option…
In the meantime, here's a minor update to the patch that adds an aria-hidden span with target inside to allow for designers to target with text or graphic open/close indicators.
Comment #7
alex_optimGood for me.
Comment #9
pifagor commentedComment #11
Anonymous (not verified) commentedDoes anyone know the status of this in Drupal 8? I don't get any errors in WAVE (web accessibility verification evaluation tool), but several screenreader apps don't seem to know how to deal with the accordions.