[tab] Ensure that correct tab panel is showing when sorting tabs.

This commit is contained in:
2026-01-13 15:10:01 -05:00
parent cfd23cd1a3
commit 97a7cabba3

View File

@@ -101,7 +101,6 @@ export function init(container = document, spacer = true, args = {}) {
const items = Array.from(ul.getElementsByTagName("li"));
items.sort((a, b) => {
console.log("here")
const aa = order.indexOf(a.textContent.trim());
const bb = order.indexOf(b.textContent.trim());
@@ -114,6 +113,7 @@ export function init(container = document, spacer = true, args = {}) {
ul.innerHTML = '';
items.forEach(item => ul.appendChild(item));
chooseTab(items[0]);
}
tabGroup.querySelectorAll('[role="tab"]').forEach(tab => {