Skip to content

Commit d550311

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 9da2424 commit d550311

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
@@ -132,8 +132,7 @@ export class MatDialogContainer
132132
// If no ariaLabelledBy or ariaLabel, create default aria label
133133
!dialogNameElement && !this._config.ariaLabel
134134
? 'Dialog Modal'
135-
: // : Otherwise prioritize use of ariaLabel
136-
this._config.ariaLabel || dialogNameElement?.innerText || dialogNameElement?.ariaLabel;
135+
: dialogNameElement?.innerText || dialogNameElement?.ariaLabel || this._config.ariaLabel;
137136
return dialogNameInnerText || 'Dialog Modal';
138137
};
139138

0 commit comments

Comments
 (0)