Disable inactive radios in multiselect pulldown
This commit is contained in:
@@ -328,6 +328,7 @@
|
||||
const radios = radioGroup.querySelectorAll('.sg-radio-field');
|
||||
radioGroup.dataset.componentState = isActive ? 'active' : 'inactive-selectable';
|
||||
radios.forEach((radio) => {
|
||||
radio.disabled = !isActive;
|
||||
if (!isActive) {
|
||||
radio.setAttribute('aria-checked', 'false');
|
||||
}
|
||||
@@ -485,12 +486,20 @@
|
||||
const radios = activatableGroup.querySelectorAll('.sg-radio-field');
|
||||
radios.forEach((otherRadio) => {
|
||||
otherRadio.setAttribute('aria-checked', String(otherRadio === radio));
|
||||
otherRadio.disabled = false;
|
||||
otherRadio.classList.remove('sg-radio-field--inactive-selectable');
|
||||
otherRadio.classList.toggle('sg-form-active', otherRadio === radio);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll('[data-activatable-radio-group="true"]').forEach((group) => {
|
||||
const isActive = group.dataset.componentState === 'active';
|
||||
group.querySelectorAll('.sg-radio-field').forEach((radio) => {
|
||||
radio.disabled = !isActive;
|
||||
});
|
||||
});
|
||||
|
||||
updateMultiselectLabelAlignment();
|
||||
window.addEventListener('resize', updateMultiselectLabelAlignment);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user