MDL-68353 core: Set aria-label for close buttons on YUI dialogues

This commit is contained in:
Shamim Rezaie 2020-04-07 20:50:13 +10:00
parent 68fd8d8bdf
commit 1b4acd4f3f
4 changed files with 14 additions and 8 deletions

View File

@ -127,8 +127,10 @@ Y.extend(DIALOGUE, Y.Panel, {
var bb;
if (this.get('closeButton') !== false) {
// The buttons constructor does not allow custom attributes
this.get('buttons').header[0].setAttribute('title', this.get('closeButtonTitle'));
var title = this.get('closeButtonTitle');
// The buttons constructor does not allow custom attributes.
this.get('buttons').header[0].setAttribute('title', title);
this.get('buttons').header[0].setAttribute('aria-label', title);
}
// Initialise the element cache.

File diff suppressed because one or more lines are too long

View File

@ -127,8 +127,10 @@ Y.extend(DIALOGUE, Y.Panel, {
var bb;
if (this.get('closeButton') !== false) {
// The buttons constructor does not allow custom attributes
this.get('buttons').header[0].setAttribute('title', this.get('closeButtonTitle'));
var title = this.get('closeButtonTitle');
// The buttons constructor does not allow custom attributes.
this.get('buttons').header[0].setAttribute('title', title);
this.get('buttons').header[0].setAttribute('aria-label', title);
}
// Initialise the element cache.

View File

@ -97,8 +97,10 @@ Y.extend(DIALOGUE, Y.Panel, {
var bb;
if (this.get('closeButton') !== false) {
// The buttons constructor does not allow custom attributes
this.get('buttons').header[0].setAttribute('title', this.get('closeButtonTitle'));
var title = this.get('closeButtonTitle');
// The buttons constructor does not allow custom attributes.
this.get('buttons').header[0].setAttribute('title', title);
this.get('buttons').header[0].setAttribute('aria-label', title);
}
// Initialise the element cache.