Aktivierbare Komponenten: kein Auto-Setzen von Werten bei Schalter an
This commit is contained in:
@@ -676,9 +676,11 @@
|
||||
return;
|
||||
}
|
||||
|
||||
options.forEach((option, index) => {
|
||||
option.setAttribute('aria-checked', String(isActive && index === 0));
|
||||
if (!isActive) {
|
||||
options.forEach((option) => {
|
||||
option.setAttribute('aria-checked', 'false');
|
||||
});
|
||||
}
|
||||
target.dataset.open = 'false';
|
||||
trigger.setAttribute('aria-expanded', 'false');
|
||||
updatePulldownSelectionState(target);
|
||||
@@ -691,17 +693,22 @@
|
||||
return;
|
||||
}
|
||||
|
||||
checkbox.setAttribute('aria-checked', String(isActive));
|
||||
checkbox.classList.toggle('sg-form-active', isActive);
|
||||
if (!isActive) {
|
||||
checkbox.setAttribute('aria-checked', 'false');
|
||||
}
|
||||
const isChecked = checkbox.getAttribute('aria-checked') === 'true';
|
||||
checkbox.classList.toggle('sg-form-active', isChecked);
|
||||
checkbox.classList.toggle('sg-checkbox-field--inactive-selectable', !isActive);
|
||||
return;
|
||||
}
|
||||
|
||||
if (componentType === 'radio-field') {
|
||||
const radios = target.querySelectorAll('.sg-radio-field');
|
||||
const defaultRadio = radios[0];
|
||||
radios.forEach((radio) => {
|
||||
const checked = isActive && radio === defaultRadio;
|
||||
if (!isActive) {
|
||||
radio.setAttribute('aria-checked', 'false');
|
||||
}
|
||||
const checked = radio.getAttribute('aria-checked') === 'true';
|
||||
radio.setAttribute('aria-checked', String(checked));
|
||||
radio.classList.toggle('sg-form-active', checked);
|
||||
radio.classList.toggle('sg-radio-field--inactive-selectable', !isActive);
|
||||
|
||||
Reference in New Issue
Block a user