]> source.dussan.org Git - gitea.git/commitdiff
Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311)
authorGiteabot <teabot@gitea.io>
Sun, 5 Mar 2023 15:05:11 +0000 (10:05 -0500)
committerGitHub <noreply@github.com>
Sun, 5 Mar 2023 15:05:11 +0000 (23:05 +0800)
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 <brecht@blender.org>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
web_src/js/features/comp/LabelEdit.js

index 313d4068218b19da69c78a470dee78bbac686e0a..18676d25e6cc94caf146eabb59ba72d4c77a99d5 100644 (file)
@@ -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');
   }
 }