From 11a9f3c6f3f75f7af1077afb5a45126b7e53975e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Mon, 25 May 2026 07:40:17 +0200 Subject: [PATCH] Fix activatable pulldown state sync timing --- components/interactive-elements.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/components/interactive-elements.html b/components/interactive-elements.html index c7320c4..95cf71d 100644 --- a/components/interactive-elements.html +++ b/components/interactive-elements.html @@ -780,15 +780,6 @@ }); }); - // Sync activatable targets to the toggle's initial state on load. - document.querySelectorAll('.sg-activation-mode-toggle[data-activation-target]').forEach((toggle) => { - const target = document.getElementById(toggle.dataset.activationTarget); - if (!target) { - return; - } - setActivatableComponentState(target, toggle.dataset.active === 'relative'); - }); - document.querySelectorAll('.sg-tab-button-group').forEach((group) => { group.querySelectorAll('.sg-tab-button').forEach((button) => { button.addEventListener('click', () => { @@ -975,6 +966,14 @@ }; document.querySelectorAll('.sg-pulldown-demo').forEach(updatePulldownSelectionState); + // Sync activatable targets to the toggle's initial state on load. + document.querySelectorAll('.sg-activation-mode-toggle[data-activation-target]').forEach((toggle) => { + const target = document.getElementById(toggle.dataset.activationTarget); + if (!target) { + return; + } + setActivatableComponentState(target, toggle.dataset.active === 'relative'); + }); // Pulldown behavior: pulldown demos open their panel below the trigger. // Opening one closes all sandwich menus and any other open pulldown demo.