Skip to content

Commit

Permalink
XWIKI-22709: XNotifications should have the alert role (#3707)
Browse files Browse the repository at this point in the history
* Added the `alert` role to xnotifications.

(cherry picked from commit 84a3e53)
  • Loading branch information
Sereza7 authored and michitux committed Dec 16, 2024
1 parent 2e9d2bc commit 1ab2831
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ widgets.Notification = Class.create({
/** Creates the HTML structure for the notification. */
createElement : function() {
if (!this.element) {
this.element = new Element("div", {"class" : "xnotification xnotification-" + this.type}).update(this.text);
// The ARIA role `alert` should give implicit values for `aria-live` and `aria-atomic`.
this.element = new Element("div", {"class" : "xnotification xnotification-" + this.type,
"role": "alert"}).update(this.text);
if (this.options.icon) {
this.element.setStyle({backgroundImage : this.options.icon, paddingLeft : "22px"});
}
Expand Down

0 comments on commit 1ab2831

Please sign in to comment.