diff options
| author | Patrick H. Lauke <[email protected]> | 2017-04-10 14:51:22 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-04-10 14:51:22 +0100 |
| commit | 18e8704221791e70d0bf4ac9ff45d4e897a02e63 (patch) | |
| tree | a3b811af9e603b2a29890a2caf65a426c22f563c /js/src/collapse.js | |
| parent | 3f6e1faf45d503d670e01b600a0455e2da0fe660 (diff) | |
| download | bootstrap-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 'js/src/collapse.js')
| -rw-r--r-- | js/src/collapse.js | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js index 88428310d..dec272297 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -162,7 +162,6 @@ const Collapse = (($) => { .addClass(ClassName.COLLAPSING) this._element.style[dimension] = 0 - this._element.setAttribute('aria-expanded', true) if (this._triggerArray.length) { $(this._triggerArray) @@ -223,8 +222,6 @@ const Collapse = (($) => { .removeClass(ClassName.COLLAPSE) .removeClass(ClassName.SHOW) - this._element.setAttribute('aria-expanded', false) - if (this._triggerArray.length) { $(this._triggerArray) .addClass(ClassName.COLLAPSED) @@ -300,7 +297,6 @@ const Collapse = (($) => { _addAriaAndCollapsedClass(element, triggerArray) { if (element) { const isOpen = $(element).hasClass(ClassName.SHOW) - element.setAttribute('aria-expanded', isOpen) if (triggerArray.length) { $(triggerArray) |
