aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPatrick H. Lauke <[email protected]>2017-04-10 14:51:22 +0100
committerGitHub <[email protected]>2017-04-10 14:51:22 +0100
commit18e8704221791e70d0bf4ac9ff45d4e897a02e63 (patch)
treea3b811af9e603b2a29890a2caf65a426c22f563c /docs
parent3f6e1faf45d503d670e01b600a0455e2da0fe660 (diff)
downloadbootstrap-18e8704221791e70d0bf4ac9ff45d4e897a02e63.tar.xz
bootstrap-18e8704221791e70d0bf4ac9ff45d4e897a02e63.zip
Fix collapse.js aria-expanded behavior
* Remove aria-expanded from collapse.js target element aria-expanded="true"/aria-expanded="false" only applies to the trigger, not the element that is being expanded/collapsed. * Tweak collapse.js accessibility section ...to make it clearer that the aria-expanded attribute always just goes on the control. * Fix collapse.js unit tests - reword some of the text to make it clear we're checking behavior of trigger/control - move incorrect aria-expanded out of the <div>s and to the actual trigger/control <a>s - fix incorrect test assertion text output false -> true
Diffstat (limited to 'docs')
-rw-r--r--docs/components/collapse.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/components/collapse.md b/docs/components/collapse.md
index 0a49db562..a86678ad1 100644
--- a/docs/components/collapse.md
+++ b/docs/components/collapse.md
@@ -119,7 +119,7 @@ You can also create accordions with custom markup. Add the `data-children` attri
## Accessibility
-Be sure to add `aria-expanded` to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
+Be sure to add `aria-expanded` to the control element. This attribute explicitly conveys the current state of the collapsible element tied to the control to screen readers and similar assistive technologies. If the collapsible element is closed by default, the attribute on the control element should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute on the control based on whether or not the collapsible element has been opened or closed (via JavaScript, or because the user triggered another control element also tied to the same collapsbile element).
Additionally, if your control element is targeting a single collapsible element – i.e. the `data-target` attribute is pointing to an `id` selector – you may add an additional `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.