1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-11 08:04:59 +02:00

Accessibility fixes to dynamic tabs (aria-selected, remove dynamic tabs with dropdowns)

* Use `aria-selected` instead of `aria-expanded`
* Change tab.js to use `aria-selected` rather than `aria-expanded`
* Add `aria-orientation=vertical` to vertical tab list
* Remove dynamic tabs with dropdowns
* Fix non-interactive code examples
* Only set `aria-selected` on the `role="tab"` trigger - this stops `aria-selected` being incorrectly added to the `role="tabpanel"` itself (probably harmless, but nonetheless incorrect)
This commit is contained in:
Patrick H. Lauke
2017-09-24 12:00:54 +02:00
committed by GitHub
parent d33b26d8c7
commit fd56ea370c
3 changed files with 79 additions and 121 deletions

View File

@@ -196,11 +196,15 @@ const Tab = (() => {
$(dropdownChild).removeClass(ClassName.ACTIVE)
}
active.setAttribute('aria-expanded', false)
if (active.getAttribute('role') === 'tab') {
active.setAttribute('aria-selected', false)
}
}
$(element).addClass(ClassName.ACTIVE)
element.setAttribute('aria-expanded', true)
if (element.getAttribute('role') === 'tab') {
element.setAttribute('aria-selected', true)
}
if (isTransitioning) {
Util.reflow(element)