mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-17 14:54:30 +01:00
Fix wrong generation of aria-labelledby
in tab navigation (#38223)
* fix wrong generation of aria-labelledby in tab navigation * fix wrong test --------- Co-authored-by: Jan Bensch <github@bensch.dev> Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
parent
e9355c6dff
commit
e00d06e45b
@ -212,7 +212,7 @@ class Tab extends BaseComponent {
|
||||
this._setAttributeIfNotExists(target, 'role', 'tabpanel')
|
||||
|
||||
if (child.id) {
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `#${child.id}`)
|
||||
this._setAttributeIfNotExists(target, 'aria-labelledby', `${child.id}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,7 +514,7 @@ describe('Tab', () => {
|
||||
expect(tabPanel.hasAttribute('tabindex')).toBeFalse()
|
||||
expect(tabPanel.hasAttribute('tabindex2')).toBeFalse()
|
||||
|
||||
expect(tabPanel.getAttribute('aria-labelledby')).toEqual('#foo')
|
||||
expect(tabPanel.getAttribute('aria-labelledby')).toEqual('foo')
|
||||
expect(tabPanel2.hasAttribute('aria-labelledby')).toBeFalse()
|
||||
})
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user