Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions js/src/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const CLASS_DROPDOWN = 'dropdown'

const SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'
const SELECTOR_DROPDOWN_MENU = '.dropdown-menu'
const SELECTOR_DROPDOWN_ITEM = '.dropdown-item'
const NOT_SELECTOR_DROPDOWN_TOGGLE = ':not(.dropdown-toggle)'

const SELECTOR_TAB_PANEL = '.list-group, .nav, [role="tablist"]'
Expand Down Expand Up @@ -231,7 +230,6 @@ class Tab extends BaseComponent {

toggle(SELECTOR_DROPDOWN_TOGGLE, CLASS_NAME_ACTIVE)
toggle(SELECTOR_DROPDOWN_MENU, CLASS_NAME_SHOW)
toggle(SELECTOR_DROPDOWN_ITEM, CLASS_NAME_ACTIVE)
outerElem.setAttribute('aria-expanded', open)
}

Expand Down
7 changes: 4 additions & 3 deletions js/tests/unit/tab.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -840,10 +840,11 @@ describe('Tab', () => {
'</ul>'
].join('')

const firstDropItem = fixtureEl.querySelector('.dropdown-item')
const dropItems = fixtureEl.querySelectorAll('.dropdown-item')

firstDropItem.click()
expect(firstDropItem).toHaveClass('active')
dropItems[1].click()
expect(dropItems[0]).not.toHaveClass('active')
expect(dropItems[1]).toHaveClass('active')
expect(fixtureEl.querySelector('.nav-link')).not.toHaveClass('active')
})

Expand Down