update aria-checked attribute dynamically

This commit is contained in:
daria 2025-05-21 13:07:09 -07:00
parent 3e98a8bed2
commit 77afbeb2ab
No known key found for this signature in database
GPG Key ID: 78018F06E7C6A3CF

View File

@ -1359,13 +1359,12 @@ define([
});
$input.change(function () {
$mark.attr('aria-checked', $input.is(':checked'));
if (!opts.labelAlt) { return; }
if ($input.is(':checked') !== checked) {
$(label).text(opts.labelAlt);
$mark.attr('aria-checked', 'true');
} else {
$(label).text(labelTxt);
$mark.attr('aria-checked', 'false');
}
});