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.
I am getting the following error which I would like to fix:
This button element does not have a name available to an accessibility API. Valid names are: title attribute, element content.
This is the code snippet it is referring to:
<button id="cboxNext" type="button"></button>
How would I go about adding a title attribute Or altogether REMOVING these links (not just hiding them from being displayed)?
Comments
Comment #1
new123456789 CreditAttribution: new123456789 commentedComment #1.0
new123456789 CreditAttribution: new123456789 commentedkljlkj
Comment #2
frjo CreditAttribution: frjo commentedThis code is from the Colorbox plugin, not the Colorbox module for Drupal.
http://jacklmoore.com/colorbox/
Comment #2.0
frjo CreditAttribution: frjo commentedddf
Comment #3
mgiffordCan we mark this as postponed and just link to this issue in colorbox?
https://github.com/jackmoore/colorbox/issues/676
Hopefully it gets fixed there and then brought in.
Comment #4
museumboy CreditAttribution: museumboy commentedAny word on this issue? I have been scouring the code to see where this could be set. Not having any success.
Comment #5
museumboy CreditAttribution: museumboy commentedI've solved this on my end.
Yes, the button issue is coming from the Colorbox code in the libraries folder, not the module. You can add an aria-label to each button in the jQuery.colorbox.js file but you'll need to make sure that change is reflected in the minified version as well or it won't take effect.
Comment #6
mgifford@museumboy could you add the issue upstream? Not sure if it is listed in the colorbox accessibility issues.
Comment #7
Anonymous (not verified) CreditAttribution: Anonymous at Cheeky Monkey Media commentedWould ensuring that the buttons have a value also work?
The example provided is an button tag
<button id="cboxNext" type="button"></button>
The settings previous, next, and close provide text for those values. I would ensure that there is a value for those, so you get something like
<button id="cboxPrevious" type="button">Previous</button><button id="cboxNext" type="button">Next</button><button id="cboxClose" type="button">Close</button>
Comment #8
mgiffordCertainly having text in the button would be helpful for semantics. Some examples here:
http://rachievee.com/use-button-element-improve-accessibility/
https://www.ssa.gov/accessibility/bpl/bps/forms/buttons/default.htm
That button text could be hidden, but it needs to be semantically there.
Comment #9
wylbur CreditAttribution: wylbur as a volunteer commentedThis is a patch to the Colorbox library 1.6.4, that adds aria labels and validates WAVE tool testing. This is a stop-gap measure to immediately fix this while we wait for a better fix to come from the Colorbox authors.
The patch was written to be applied within the Colorbox library folder. Just add the file and apply the patch. The patch updates the JS and minified JS files.
This patch comes from code provided here - https://github.com/jackmoore/colorbox/pull/822
You can follow the full issue here - https://github.com/jackmoore/colorbox/issues/765
The original author talks about this code in the March 28th comment - jameswilson commented on Mar 28 0001-Adding-ARIA-labels-to-colorbox-library-1.6.4
Comment #10
Liam MorlandIt looks like Colorbox is not going to be fixed on Github. Is the maintainer willing to modify the version used by this Drupal module?
Comment #11
Liam MorlandComment #12
pranit84Updating Patch file for testing - Testing Patch (NOT WORKING)
Comment #13
pranit84Accessibility Issue fixed for Colorbox with this patch.
Comment #14
pranit84Fixing issues of Patch to get it applied in working condition.
Comment #15
mgiffordChanging status based on Liam's comment in #10.
Comment #18
interdruper CreditAttribution: interdruper at Interdruper commentedI can confirm that patch #14 fixes the error under WAVE AA-checker.
Patch applies over the library, not the module, so it is valid also for 8.x.
Comment #19
hkirsman CreditAttribution: hkirsman commentedShouldn't this patch also be added to the modules .make file (https://cgit.drupalcode.org/colorbox/tree/colorbox.make?h=7.x-2.x&id=7.x...) where the library is defined?
Comment #20
hkirsman CreditAttribution: hkirsman commentedComment #21
Bwolf CreditAttribution: Bwolf commentedCan this patch also be used on the Drupal 8 Version?
Comment #23
swhitters CreditAttribution: swhitters as a volunteer commentedIt's not working for me. I still get errors when checking in the WAVE checker. I use colorbox AND colorbox node, so admittedly, it could be the other module or a combination.
There are 3 buttons that this won't apply to: cboxprevious, cboxnext, and cboxslideshow
Also of note, there's a typo in the patch where it says "lable" and not "label". However, fixing this had no effect for me.
There's also a newer fix on github: https://github.com/jackmoore/colorbox/pull/832
Comment #24
scott_earnest CreditAttribution: scott_earnest commentedAs a workaround, I put this code inside of a custom .js file:
Comment #25
Neslee Canil PintoPatch Failed to apply, needs reroll
Comment #26
Neslee Canil PintoComment #27
robcarrFor more detail on this problem, go to https://github.com/jackmoore/colorbox/issues/765