Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Tabs are missing fully functional exampleΒ #3584

Closed
@im-n1

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")
     })
 }

Metadata

Assignees

No one assigned

    Labels

    Unresolved (Archived)Open and unresolved issues and PRs that were closed due to archiving the repository.backlogdocs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions