From 5b9f8aa061b7ee1a71ef0f3285e2ec2756a57899 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Thu, 31 Jul 2025 18:58:07 -0400 Subject: fix a recursion bug in the tabsyncing --- docs/tabsync.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/tabsync.js') diff --git a/docs/tabsync.js b/docs/tabsync.js index 86e54b1c..935e42a2 100644 --- a/docs/tabsync.js +++ b/docs/tabsync.js @@ -4,6 +4,8 @@ document.addEventListener("DOMContentLoaded", function () { for (const tab of tabs) { tab.addEventListener("click", () => { + if (tab.dataset.syncing === "true") return; + const currentLabel = document.querySelector(`label[for="${tab.id}"]`); if (!currentLabel) return; @@ -19,7 +21,9 @@ document.addEventListener("DOMContentLoaded", function () { const inputId = label.getAttribute("for"); const input = document.getElementById(inputId); if (input && input !== tab) { + input.dataset.syncing = "true"; input.click(); + input.dataset.syncing = "false"; } } } -- cgit v1.3.1