-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Aria Accessibility compliance. fixes #765 #822
base: master
Are you sure you want to change the base?
Aria Accessibility compliance. fixes #765 #822
Conversation
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'`.
As I just mentioned over on 765, the original code here did not pass HTML_CodeSniffer, but passes the http://wave.webaim.org @jackmoore If you're interested in having this as the definitive solution, I've just fixed this to incorporate the code from PR #821 into this one, so you can close and ignore 821, and just use this one. |
@jameswilson This is great, but I'm noticing a typo:
Should be |
You're totally right @jerseycheese. Sorry about that -- just sent a fix for that in a2b39f2. Anything else? I suppose I could squash the three commits into one before merge if @jackmoore wants to have a cleaner git history. |
Also, @jackmoore: do need me to run the js through a minifier in the PR? |
I was just looking into updating colorbox for better accessibility myself and found you've already done most the work!
|
@Enchiridion Thanks for the feedback!
This is a case where it would really be useful to have maintainer feedback 😞 @jackmoore I'm tempted not to add extra text label fields. The problem with the two fields for each button is that someone will unwittingly add the same text in both places, which might actually hurt accessibility, no? It means you'd have to add extra code to check for the various different conditions like if both are non-empty which one do you use which one do you hide with
The original purpose of this PR was just be able to pass WAVE. I'd be happy if you cloned from my fork, and added a sub-feature-branch off of the 756-accessibility-compliance branch, submit a PR that I could merge into this one. Not sure if this is the right procedure or not, so let me know.
The reason for this is because that code runs before a colorbox instance has been initiated and even so all you have available are the defaults anyway, so to make the code shorter I just used duplicate strings from the defaults. I'm curious if you have a better idea here. |
Hope this gets pulled soon. But project looks dead :( |
Is there a reason |
This is a formal approach to fixing #765 with proper use of Aria attributes and is an alternative to PR #821 (Update: #821 has been incorporated into this PR).
Changes include:
Add
aria-hidden
attributes on the dialog box and navigational buttons.Update the
aria-hidden
value totrue
orfalse
at the appropriate times.Add
aria-label
attributes to navigational buttons using the colorbox default settings at page load time and then updating the value based on user-settings when a colorbox is loaded.Add
aria-labelledby
andaria-describedby
attributes to the div containingrole='dialog'
.