Add code to auto select tabs
This commit is contained in:
@@ -10,6 +10,7 @@ const click = new MouseEvent('click', {
|
||||
});
|
||||
|
||||
export function init(p = document, s = true) {
|
||||
|
||||
p.querySelectorAll(".tab-group, tabset").forEach(tabGroup => {
|
||||
|
||||
if (tabGroup.querySelector("[role=tablist]") === null) {
|
||||
@@ -62,5 +63,9 @@ export function init(p = document, s = true) {
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
if (document.location.hash != "" && document.location.hash.substring(0,5) == "#tab-") {
|
||||
document.querySelector(document.location.hash).dispatchEvent(click);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user