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
refactor(material/stepper): cleans up unnecessary roles/attributes
Updates previous fix to Angular Components stepper to remove
unnecessary roles and attributes. Also updates Stepper docs with
latest vertical stepper aria attribute and role changes. Updates
stepper-demo heading level elements for accessibility purposes.
Copy file name to clipboardExpand all lines: src/material/stepper/stepper.md
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -228,12 +228,17 @@ export class MyApp {}
228
228
<!-- example(stepper-intl) -->
229
229
230
230
### Accessibility
231
-
The stepper is treated as a tabbed view for accessibility purposes, so it is given
232
-
`role="tablist"` by default. The header of step that can be clicked to select the step
231
+
The stepper is treated as a tabbed view for accessibility purposes.
232
+
233
+
For a horizontal stepper, based on its structure it is given `role="tablist"` by default. The header of step that can be clicked to select the step
233
234
is given `role="tab"`, and the content that can be expanded upon selection is given
234
235
`role="tabpanel"`. `aria-selected` attribute of step header is automatically set based on
235
236
step selection change.
236
237
238
+
For a vertical stepper, based on its structure it is given `role="tree"` by default. The `.mat-step` of each vertical step that can be clicked to select the step
239
+
is given `role="treeitem"`, and the `.mat-step` gets an `aria-selected` and `aria-expanded` attribute of the `tree-item` is automatically set based on
240
+
step selection change.
241
+
237
242
The stepper and each step should be given a meaningful label via `aria-label` or `aria-labelledby`.
238
243
239
244
Prefer vertical steppers when building for small screen sizes, as horizontal
0 commit comments