From 92959434ec2538bfa6c2dca9755ea0842f0f5d5e Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 4 Mar 2023 22:28:28 +0100 Subject: [PATCH] Scoped labels: set aria-disabled on muted Exclusive option for a11y 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 --- 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 313d4068218b1..18676d25e6cc9 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'); } }