Add initial tabindex handling for tabs

set `tabindex` as well as `aria-selected` on tabs
This commit is contained in:
patrickhlauke 2019-06-17 23:45:07 +01:00
parent c5b1919dea
commit f4d85517b9

View file

@ -183,12 +183,14 @@ class Tab {
if (active.getAttribute('role') === 'tab') {
active.setAttribute('aria-selected', false)
active.setAttribute('tabindex', '-1')
}
}
element.classList.add(ClassName.ACTIVE)
if (element.getAttribute('role') === 'tab') {
element.setAttribute('aria-selected', true)
element.setAttribute('tabindex', '0')
}
reflow(element)