Problem/Motivation
This is great module. I used this module for brand kit table. Our table shows download now link multiple times for different files. As per ADA, we need to add aria-label to provide more detail to screen readers.
Steps to reproduce
Proposed resolution
Added configuration for aria-label in field formatter settings with token support. So we can configure the parent field values as aria-label.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | file_download_link-support_aria_label-3318657-10.patch | 9.05 KB | chrissnyder |
| #6 | Screenshot from 2022-11-11 14-59-27.png | 70.63 KB | iyyappan.govind |
Issue fork file_download_link-3318657
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
iyyappan.govindHere is the patch. Please review my patch.
Comment #3
iyyappan.govindComment #5
danflanagan8Thank you very much for this issue, @iyyappan.govind!
I have always suspected there was more a11y stuff that could be done here, but I am far from an expert in that realm.
I have a question about aria-label. Would it be typical for the aria-label to be identical to any of the other fields we already have? For example, is the aria-label usually the same as the title? Or is the aria-label usually the same as the visible label?
Comment #6
iyyappan.govindHi @danflanagan8
Yes ARIA labels should explain actual context of the file to screen reader. If we have a 4 Download link in same page then it will not have more information to screen readers. So it is difficult for user to understand the what that Download link will do. So ARIA label should not be static. I used Media name or Media Description field as token in ARIA label in formatter configuration after I added the above patch which is more informative. I hope this helps. Thanks!!
Comment #9
chrissnyderThank you for your work on this @iyyappan.govind!
I've opened a MR with the changes from the above patch and made a few changes to ensure that tests still pass and this functionally will still work if the token module is not installed.
Attached is a patch mirroring the MR for patching your own project.
Comment #10
chrissnyderUpdate patch file with the recent fix to aria label HTML attribute.
Comment #11
chrissnyderNote: Currently, the patch will not apply to the current stable 2.0.3 version of this module. In order to apply this patch to your site/project, you will need to include additional commits/patches that are currently only on the dev branch.
If using composer-patches, update your composer.json with the following in the "patches" config:
Comment #14
astonvictor commented