0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-28 18:34:10 -05:00

Scoped labels: set aria-disabled on muted Exclusive option for a11y (#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>
This commit is contained in:
Giteabot 2023-03-05 10:05:11 -05:00 committed by GitHub
parent 17ae7e335e
commit e3b1ebbbfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,7 @@ function updateExclusiveLabelEdit(form) {
if (isExclusiveScopeName(nameInput.val())) { if (isExclusiveScopeName(nameInput.val())) {
exclusiveField.removeClass('muted'); exclusiveField.removeClass('muted');
exclusiveField.removeAttr('aria-disabled');
if (exclusiveCheckbox.prop('checked') && exclusiveCheckbox.data('exclusive-warn')) { if (exclusiveCheckbox.prop('checked') && exclusiveCheckbox.data('exclusive-warn')) {
exclusiveWarning.removeClass('gt-hidden'); exclusiveWarning.removeClass('gt-hidden');
} else { } else {
@ -20,6 +21,7 @@ function updateExclusiveLabelEdit(form) {
} }
} else { } else {
exclusiveField.addClass('muted'); exclusiveField.addClass('muted');
exclusiveField.attr('aria-disabled', 'true');
exclusiveWarning.addClass('gt-hidden'); exclusiveWarning.addClass('gt-hidden');
} }
} }