Skip to content

Commit

Permalink
XWIKI-22709: XNotifications should have the alert role
Browse files Browse the repository at this point in the history
* Added the `alert` role to xnotifications.
  • Loading branch information
Sereza7 committed Dec 2, 2024
1 parent 4e2efc8 commit c4c578b
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 c4c578b

Please sign in to comment.