You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(material/dialog): dialog name not read by screenreader on mac chrome or firefox
Fixes bug in Angular Components Dialog component where the aria-labelledby
and aria-describedby values are not being read by Chrome or Firefox when
using a mac. This checks if there is an html attribute of aria-labelledby
or aria-describedby and grabs the innerText or aria-label value and uses
that value as the aria-label for the dialog only on mac using chrome or
firefox.
Fixes b/274674581
|`mat-dialog-title`|\[Attr] Dialog title, applied to a heading element (e.g., `<h1>`, `<h2>`) |
96
-
|`<mat-dialog-content>`| Primary scrollable content of the dialog. |
97
-
|`<mat-dialog-actions>`| Container for action buttons at the bottom of the dialog. Button alignment can be controlled via the `align` attribute which can be set to `end` and `center`. |
98
-
|`mat-dialog-close`|\[Attr] Added to a `<button>`, makes the button close the dialog with an optional result from the bound value.|
|`mat-dialog-title`|\[Attr] Dialog title, applied to a heading element (e.g., `<h1>`, `<h2>`) |
99
+
|`<mat-dialog-content>`| Primary scrollable content of the dialog. |
100
+
|`<mat-dialog-actions>`| Container for action buttons at the bottom of the dialog. Button alignment can be controlled via the `align` attribute which can be set to `end` and `center`. |
101
+
|`mat-dialog-close`|\[Attr] Added to a `<button>`, makes the button close the dialog with an optional result from the bound value.|
99
102
100
103
For example:
104
+
101
105
```html
102
106
<h2mat-dialog-title>Delete all elements?</h2>
103
107
<mat-dialog-content>This will delete all elements that are currently on this page and cannot be undone.</mat-dialog-content>
@@ -119,6 +123,7 @@ You can control which elements are tab stops with the `tabindex` attribute
119
123
<!-- example(dialog-content) -->
120
124
121
125
### Controlling the dialog animation
126
+
122
127
You can control the duration of the dialog's enter and exit animations using the
123
128
`enterAnimationDuration` and `exitAnimationDuration` options. If you want to disable the dialog's
124
129
animation completely, you can do so by setting the properties to `0ms`.
@@ -130,11 +135,10 @@ animation completely, you can do so by setting the properties to `0ms`.
130
135
`MatDialog` creates modal dialogs that implements the ARIA `role="dialog"` pattern by default.
131
136
You can change the dialog's role to `alertdialog` via `MatDialogConfig`.
132
137
133
-
You should provide an accessible label to this root dialog element by setting the `ariaLabel` or
134
-
`ariaLabelledBy` properties of `MatDialogConfig`. You can additionally specify a description element
135
-
ID via the `ariaDescribedBy` property of `MatDialogConfig`.
138
+
In order to make your dialog title/name known and read by all screenreaders regardless of OS or browser, you should provide an accessible label to this root dialog element. You can do so either by setting the dialog name/title as a value to the `ariaLabel` property of `MatDialogConfig` or providing the id of the respective element with the dialog name as `ariaLabelledBy` property of `MatDialogConfig`. You can additionally specify a description element ID via the `ariaDescribedBy` property of `MatDialogConfig`. If none of these properties (`ariaLabel`,`ariaLabelledBy`, or `ariaDescribedBy`) are applied to `MatDialogConfig` the default aria-label value will be "Dialog Modal".
136
139
137
140
#### Keyboard interaction
141
+
138
142
By default, the escape key closes `MatDialog`. While you can disable this behavior via
139
143
the `disableClose` property of `MatDialogConfig`, doing this breaks the expected interaction
140
144
pattern for the ARIA `role="dialog"` pattern.
@@ -146,12 +150,12 @@ When opened, `MatDialog` traps browser focus such that it cannot escape the root
146
150
You can customize which element receives focus with the `autoFocus` property of
147
151
`MatDialogConfig`, which supports the following values.
0 commit comments