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) (#23311)

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>
  • Loading branch information
3 people authored Mar 5, 2023
1 parent 17ae7e3 commit e3b1ebb
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 e3b1ebb

Please sign in to comment.