Fix activatable pulldown state sync timing
This commit is contained in:
@@ -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) => {
|
document.querySelectorAll('.sg-tab-button-group').forEach((group) => {
|
||||||
group.querySelectorAll('.sg-tab-button').forEach((button) => {
|
group.querySelectorAll('.sg-tab-button').forEach((button) => {
|
||||||
button.addEventListener('click', () => {
|
button.addEventListener('click', () => {
|
||||||
@@ -975,6 +966,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
document.querySelectorAll('.sg-pulldown-demo').forEach(updatePulldownSelectionState);
|
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.
|
// Pulldown behavior: pulldown demos open their panel below the trigger.
|
||||||
// Opening one closes all sandwich menus and any other open pulldown demo.
|
// Opening one closes all sandwich menus and any other open pulldown demo.
|
||||||
|
|||||||
Reference in New Issue
Block a user