From 7ac7d26f864b4c72f7bc24c0ee2e84d12ef9c32a Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Tue, 28 Jun 2022 11:48:03 -0500 Subject: [PATCH] Add `alert` role to notifications so they're automatically spoken by screen readers. (#6743) --- core/modules/utils/dom/notifier.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/utils/dom/notifier.js b/core/modules/utils/dom/notifier.js index 3897b0e52..bf93d451c 100644 --- a/core/modules/utils/dom/notifier.js +++ b/core/modules/utils/dom/notifier.js @@ -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