Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass accessibility tests. fixes #765 #821

Conversation

jameswilson
Copy link

@jameswilson jameswilson commented Mar 28, 2017

This is option 1 fix for #765.

The approach here adds button text from colorbox defaults at page load time to avoid the following errors reported by accessibility tests:

  • wave.webaim.org:

    A button is empty or has no value text.
    
  • HTML_CodeSniffer WCAG 2.0 Level AAA:

    This button element does not have a name available to an
    accessibility API. Valid names are: title attribute, element
    content.
    

The approach here adds button text from colorbox defaults at page
load time to avoid the following errors reported by accessibility
tests:

* wave.webaim.org:

      A button is empty or has no value text.

* HTML_CodeSniffer WCAG 2.0 Level AAA:

      This button element does not have a name available to an
      accessibility API. Valid names are: title attribute, element
      content.
jameswilson added a commit to BluesparkLabs/colorbox that referenced this pull request Mar 28, 2017
This is a formal approach to fixing jackmoore#765 with proper use of Aria
attributes as an alternative to PR jackmoore#821.

Changes include:

*  Add `aria-hidden` attributes on the dialog box and navigational
   buttons.

*  Update the `aria-hidden` value to `true` or `false` at the
   appropriate times.

*  Add `aria-label` attributes to navigational buttons, using the
   colorbox default settings at page load time, and then update the
   value when a colorbox is loaded.

*  Add `aria-labelledby` and `aria-describedby` attributes to the
   div containing `role='dialog'`.
@jameswilson
Copy link
Author

#822 is the better solution at this point. closing.

@jameswilson jameswilson deleted the 765-pass-accessibility-tests branch June 15, 2017 14:37
cdubz added a commit to CascadePublicMedia/colorbox that referenced this pull request Dec 14, 2021
* Aria Accessibility compliance. fixes jackmoore#765

This is a formal approach to fixing jackmoore#765 with proper use of Aria
attributes as an alternative to PR jackmoore#821.

Changes include:

*  Add `aria-hidden` attributes on the dialog box and navigational
   buttons.

*  Update the `aria-hidden` value to `true` or `false` at the
   appropriate times.

*  Add `aria-label` attributes to navigational buttons, using the
   colorbox default settings at page load time, and then update the
   value when a colorbox is loaded.

*  Add `aria-labelledby` and `aria-describedby` attributes to the
   div containing `role='dialog'`.

* Pass HTML_CodeSniffer WCAG 2.0 tests

* Cleanup unneeded aria-labels, fix autoreading of dialog by using ARIA live regions and ensure focus is on the first element in the dialog when it opens

* Fix spelling of 'aria-label'

* Cleanup unneeded aria-labels, fix autoreading of dialog by using ARIA live regions and ensure focus is on the first element in the dialog when it opens

* Reworked focus trapping

* Updated minified version

Co-authored-by: James Wilson <[email protected]>
Co-authored-by:  <[email protected]>
Co-authored-by: Bram Duvigneau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant