Skip to content

Commit e43bcd2

Browse files
committed
refactor(material/stepper): update aria-attributes for horizontal stepper
Updates previous changes to only use aria-expanded for vertical stepper and to add aria-pressed and aria-current values depending on the selectedIndex value.
1 parent 49d8a4a commit e43bcd2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/material/stepper/stepper.html

+3-2
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@
7272
<mat-step-header
7373
[class.mat-horizontal-stepper-header]="orientation === 'horizontal'"
7474
[class.mat-vertical-stepper-header]="orientation === 'vertical'"
75-
role="button"
7675
(click)="step.select()"
7776
(keydown)="_onKeydown($event)"
7877
[tabIndex]="_getFocusIndex() === i ? 0 : -1"
7978
[id]="_getStepLabelId(i)"
8079
[attr.aria-controls]="_getStepContentId(i)"
81-
[attr.aria-expanded]="selectedIndex == i"
80+
[attr.aria-expanded]="orientation === 'vertical' ? selectedIndex == i : undefined"
81+
[attr.aria-current]="selectedIndex == i ? 'step' : undefined"
82+
[attr.aria-pressed]="selectedIndex == i"
8283
[attr.aria-label]="step.ariaLabel || null"
8384
[attr.aria-labelledby]="(!step.ariaLabel && step.ariaLabelledby) ? step.ariaLabelledby : null"
8485
[attr.aria-disabled]="_stepIsNavigable(i, step) ? null : true"

0 commit comments

Comments
 (0)