Skip to content

Commit

Permalink
Scoped labels: set aria-disabled on muted Exclusive option for a11y (#…
Browse files Browse the repository at this point in the history
…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: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
brechtvl and lunny authored Mar 5, 2023
1 parent 5d621fe commit e893560
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 e893560

Please sign in to comment.