Skip to content

Commit

Permalink
Scoped labels: set aria-disabled on muted Exclusive option for a11y (g…
Browse files Browse the repository at this point in the history
…o-gitea#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 go-gitea#22974

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
2 people authored and GiteaBot committed Mar 5, 2023
1 parent 17ae7e3 commit d6da198
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web_src/js/features/comp/LabelEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ 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 {
exclusiveWarning.addClass('gt-hidden');
}
} else {
exclusiveField.addClass('muted');
exclusiveField.attr('aria-disabled', 'true');
exclusiveWarning.addClass('gt-hidden');
}
}
Expand Down

0 comments on commit d6da198

Please sign in to comment.