[Accordion]: Make content accessible without JavaScript#1224
Merged
Conversation
added 10 commits
June 3, 2016 10:21
Contributor
Author
|
Oh, and I also updated the tables documentation to use double-quoted attributes, for consistency. 😬 |
Contributor
Author
|
cc #1121 |
| </li> | ||
| <li> | ||
| Each content area has an <code>aria-hidden</code> attribute set to either <code>true</code> or <code>false</code>. When <code>true</code>, the element (and all children) are neither visible or perceivable, and assistive technologies will skip this content. | ||
| Each content area will have its <code>aria-hidden</code> attribute set to either <code>true</code> or <code>false</code> by the component, depending on its corresponding button’s <code>aria-expaded</code> attribute. To ensure that your content is accessible in the event that the JavaScript does not load or is disabled, you should not set <code>aria-hidden=<wbr>"true"</wbr></code> on any of your content areas. |
There was a problem hiding this comment.
@kategarklavs & @shawnbot - "aria-expaded" shouldn't that be "aria-expanded"
Contributor
|
@shawnbot I just looked over everything and have no proposed changes 👍 |
Contributor
Author
|
🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the accordion component to update its buttons' and corresponding content elements'
aria-expandedandaria-hiddenattributes (respectively) when initialized. This means that we can strip all of thearia-expanded="false"andaria-hidden="true"attributes from the HTML, which makes the content accessible in the event that the JS isn't loaded (or until it is). Hopefully, this addresses #1122.aria-expanded="false"andaria-hidden="true"attributes from accordion panels that aren't expanded by default so that their content is accessible without JS.Additional information
aria-expanded="false"andaria-hidden="true"attributes out, so that the content is accessible without JavaScript.aria-expandedandaria-hiddenattributes are unnecessary now (except in the case of the content area that you wish to be expanded by default), but this could probably use some clarification and/or word-smithing from @kategarklavs.amendment-n+1naming convention instead ofcollapsible-n, so that it plays nicely with the the Code and Documentation accordion below. See: [UI components] Documentation pages have duplicate ids #1225thisfrom itsshow(),hide(), andhideAll()methods, so its methods are chainable. I'm happy to back out of this change if it's not consistent with the rest of the library.