mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-18 11:21:23 +02:00
Fix ?
This commit is contained in:
@@ -109,12 +109,13 @@ class Tab extends BaseComponent {
|
||||
this._activate(SelectorEngine.getElementFromSelector(element)) // Search and activate/show the proper section
|
||||
|
||||
const complete = () => {
|
||||
element.removeAttribute('tabindex')
|
||||
|
||||
if (element.getAttribute('role') !== 'tab') {
|
||||
element.classList.add(CLASS_NAME_SHOW)
|
||||
return
|
||||
}
|
||||
|
||||
element.removeAttribute('tabindex')
|
||||
element.setAttribute('aria-selected', true)
|
||||
this._toggleDropDown(element, true)
|
||||
EventHandler.trigger(element, EVENT_SHOWN, {
|
||||
@@ -136,13 +137,14 @@ class Tab extends BaseComponent {
|
||||
this._deactivate(SelectorEngine.getElementFromSelector(element)) // Search and deactivate the shown section too
|
||||
|
||||
const complete = () => {
|
||||
element.setAttribute('tabindex', '-1')
|
||||
|
||||
if (element.getAttribute('role') !== 'tab') {
|
||||
element.classList.remove(CLASS_NAME_SHOW)
|
||||
return
|
||||
}
|
||||
|
||||
element.setAttribute('aria-selected', false)
|
||||
element.setAttribute('tabindex', '-1')
|
||||
this._toggleDropDown(element, false)
|
||||
EventHandler.trigger(element, EVENT_HIDDEN, { relatedTarget: relatedElem })
|
||||
}
|
||||
@@ -162,6 +164,8 @@ class Tab extends BaseComponent {
|
||||
|
||||
if (nextActiveElement) {
|
||||
nextActiveElement.focus({ preventScroll: true })
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(nextActiveElement)
|
||||
Tab.getOrCreateInstance(nextActiveElement).show()
|
||||
}
|
||||
}
|
||||
@@ -231,7 +235,6 @@ class Tab extends BaseComponent {
|
||||
|
||||
toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE)
|
||||
toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW)
|
||||
outerElem.setAttribute('aria-expanded', open)
|
||||
}
|
||||
|
||||
_setAttributeIfNotExists(element, attribute, value) {
|
||||
@@ -285,6 +288,8 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
|
||||
return
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(this)
|
||||
Tab.getOrCreateInstance(this).show()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user