Add `alert` role to notifications so they're automatically spoken by screen readers. (#6743)

This commit is contained in:
Nolan Darilek 2022-06-28 11:48:03 -05:00 committed by GitHub
parent f02bd2392f
commit 7ac7d26f86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -36,8 +36,9 @@ Notifier.prototype.display = function(title,options) {
if(!tiddler) {
return;
}
// Add classes
// Add classes and roles
$tw.utils.addClass(notification,"tc-notification");
notification.setAttribute("role","alert");
// Create the variables
var variables = $tw.utils.extend({currentTiddler: title},options.variables);
// Render the body of the notification