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