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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user