From e3b1ebbbfed7fac634eedf62a28d9dfdb990d22d Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sun, 5 Mar 2023 10:05:11 -0500 Subject: [PATCH] Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311) Backport #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: Brecht Van Lommel 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'); } }