From e8935606f5f1fff3c59222ebca6d4615ab06fb0b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 5 Mar 2023 14:25:25 +0100 Subject: [PATCH] Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) It is convenient to be able to toggle off this option after removing / from the name. This ensures the muted state is communicated to blind users even when the input is not fully disabled. Part of #22974 Co-authored-by: Lunny Xiao --- web_src/js/features/comp/LabelEdit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_src/js/features/comp/LabelEdit.js b/web_src/js/features/comp/LabelEdit.js index 313d406821..18676d25e6 100644 --- a/web_src/js/features/comp/LabelEdit.js +++ b/web_src/js/features/comp/LabelEdit.js @@ -13,6 +13,7 @@ function updateExclusiveLabelEdit(form) { if (isExclusiveScopeName(nameInput.val())) { exclusiveField.removeClass('muted'); + exclusiveField.removeAttr('aria-disabled'); if (exclusiveCheckbox.prop('checked') && exclusiveCheckbox.data('exclusive-warn')) { exclusiveWarning.removeClass('gt-hidden'); } else { @@ -20,6 +21,7 @@ function updateExclusiveLabelEdit(form) { } } else { exclusiveField.addClass('muted'); + exclusiveField.attr('aria-disabled', 'true'); exclusiveWarning.addClass('gt-hidden'); } }