Skip to content

Commit 119d68b

Browse files
committed
refactor(material/dialog): updates prioritization order of aria-label adoption
Updates to put aria-labelledby values as the priority and the aria-label as the backup.
1 parent 8530e1e commit 119d68b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/material/dialog/dialog-container.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ export class MatDialogContainer
134134
// If no ariaLabelledBy or ariaLabel, create default aria label
135135
!dialogNameElement && !this._config.ariaLabel
136136
? 'Dialog Modal'
137-
: // : Otherwise prioritize use of ariaLabel
138-
this._config.ariaLabel || dialogNameElement?.innerText || dialogNameElement?.ariaLabel;
137+
: dialogNameElement?.innerText || dialogNameElement?.ariaLabel || this._config.ariaLabel;
139138
return dialogNameInnerText || 'Dialog Modal';
140139
};
141140

0 commit comments

Comments
 (0)