This repository has been archived by the owner on Jan 13, 2025. It is now read-only.
Closed
Description
From documentation and even readme in the module following part has dissapeared. I'm not sure if it's still correct but without this nobody is able to get fully functional tabs.
for (const e of document.querySelectorAll(".mdc-tab-bar")) {
let tab = new MDCTabBar(e)
tab.preventDefaultOnClick = true
tab.listen("MDCTabBar:change", function({detail: tabs}) {
let index = tabs.activeTabIndex
let panels = this.nextElementSibling
// Hide all panels.
for (const t of panels.querySelectorAll(":scope > .tab-panel"))
t.classList.remove("active")
// Show the current one.
let tab = panels.querySelector(":scope > .tab-panel:nth-child(" + (index + 1) + ")")
tab.classList.add("active")
})
}