Fix activatable pulldown enabling behavior

This commit is contained in:
2026-05-25 07:38:29 +02:00
parent c54283448a
commit 6a844f565c
+9
View File
@@ -700,11 +700,20 @@
return;
}
const hasSelectedOption = Array.from(options).some((option) => option.getAttribute('aria-checked') === 'true');
if (isActive && !hasSelectedOption) {
options[0].setAttribute('aria-checked', 'true');
}
if (!isActive) {
options.forEach((option) => {
option.setAttribute('aria-checked', 'false');
});
}
options.forEach((option) => {
option.classList.toggle('sg-checkbox-field--inactive-selectable', !isActive);
option.classList.toggle('sg-form-active', option.getAttribute('aria-checked') === 'true');
});
target.dataset.open = 'false';
trigger.setAttribute('aria-expanded', 'false');
updatePulldownSelectionState(target);