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)?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

new123456789’s picture

Project: Views Slideshow » Colorbox
Version: 7.x-3.0 » 7.x-2.4
new123456789’s picture

Issue summary: View changes

kljlkj

frjo’s picture

Status: Active » Closed (works as designed)

This code is from the Colorbox plugin, not the Colorbox module for Drupal.

http://jacklmoore.com/colorbox/

frjo’s picture

Issue summary: View changes

ddf

mgifford’s picture

Issue summary: View changes
Status: Closed (works as designed) » Postponed
Issue tags: +Accessibility

Can 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.

museumboy’s picture

Any word on this issue? I have been scouring the code to see where this could be set. Not having any success.

museumboy’s picture

I'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.

mgifford’s picture

@museumboy could you add the issue upstream? Not sure if it is listed in the colorbox accessibility issues.

Anonymous’s picture

Would 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>

mgifford’s picture

Certainly 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.

wylbur’s picture

This 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

Liam Morland’s picture

It looks like Colorbox is not going to be fixed on Github. Is the maintainer willing to modify the version used by this Drupal module?

Liam Morland’s picture

Category: Support request » Bug report
pranit84’s picture

Updating Patch file for testing - Testing Patch (NOT WORKING)

pranit84’s picture

Accessibility Issue fixed for Colorbox with this patch.

pranit84’s picture

Fixing issues of Patch to get it applied in working condition.

mgifford’s picture

Status: Postponed » Needs review

Changing status based on Liam's comment in #10.

The last submitted patch, 9: Adding-ARIA-labels-to-colorbox-library-1.6.4.patch, failed testing. View results

interdruper’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

hkirsman’s picture

Shouldn'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?

hkirsman’s picture

Status: Reviewed & tested by the community » Needs review
Bwolf’s picture

Can this patch also be used on the Drupal 8 Version?

Status: Needs review » Needs work
swhitters’s picture

It'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

<button type="button" id="cboxPrevious">
<button type="button" id="cboxNext">
<button type="button" id="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

scott_earnest’s picture

As a workaround, I put this code inside of a custom .js file:

$(document).ready(function() {
  // ColorBox button labels for ADA compliance
    if($("#colorbox").length){
      $('#cboxPrevious').attr("aria-label", "Previous");
      $('#cboxNext').attr("aria-label", "Next");
      $('#cboxSlideshow').attr("aria-label", "Slideshow");
  }
});
Neslee Canil Pinto’s picture

Issue tags: +Needs reroll

Patch Failed to apply, needs reroll

Neslee Canil Pinto’s picture

Status: Needs work » Closed (works as designed)
Issue tags: -Needs reroll
robcarr’s picture

For more detail on this problem, go to https://github.com/jackmoore/colorbox/issues/765