From 18e8704221791e70d0bf4ac9ff45d4e897a02e63 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Mon, 10 Apr 2017 14:51:22 +0100 Subject: 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
s and to the actual trigger/control s - fix incorrect test assertion text output false -> true --- js/src/collapse.js | 4 ---- 1 file changed, 4 deletions(-) (limited to 'js/src') 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) -- cgit v1.2.3