From 8c568c4a9d3dcb8e6e0dda31cafd6ab823ad3209 Mon Sep 17 00:00:00 2001 From: Davide Marchegiani Date: Thu, 19 Sep 2024 16:59:33 +1000 Subject: [PATCH] Fix tabFunctionality JS function to open the first tab in case there is a cookie with a tab ID not in the page. --- docs/js/miscellaneous.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/js/miscellaneous.js b/docs/js/miscellaneous.js index e1a83feef..0adb31596 100644 --- a/docs/js/miscellaneous.js +++ b/docs/js/miscellaneous.js @@ -69,7 +69,7 @@ function tabFunctionality() { let label = tabLabels.getAttribute("label"); let tabID; if (sessionStorage.getItem(`tabs-label=${label}`)) { - tabID = sessionStorage.getItem(`tabs-label=${label}`); + tabID = document.getElementById(tabID) ? sessionStorage.getItem(`tabs-label=${label}`) : tabLabels.firstElementChild.id; } else if (tabLabels.querySelector(".activeTab")) { tabID = tabLabels.querySelector(".activeTab").id; } else {