Skip to content
/ gitea Public
forked from go-gitea/gitea

Commit

Permalink
Scoped labels: set aria-disabled on muted Exclusive option for a11y
Browse files Browse the repository at this point in the history
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
  • Loading branch information
brechtvl committed Mar 4, 2023
1 parent 5c4075e commit 9295943
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 9295943

Please sign in to comment.