Skip to content

Commit fb41276

Browse files
committed
fix(material/stepper): add text for screen readers to indicate when step is complete or editable
1 parent 881edec commit fb41276

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/material/stepper/step-header.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
[ngTemplateOutletContext]="_getIconContext()"></ng-container>
1111
<ng-container *ngSwitchDefault [ngSwitch]="state">
1212
<span *ngSwitchCase="'number'">{{_getDefaultTextForState(state)}}</span>
13+
<span class="cdk-visually-hidden" *ngIf="state === 'done'">
14+
{{_intl.completedLabel}}
15+
</span>
16+
<span class="cdk-visually-hidden" *ngIf="state === 'edit'">
17+
{{_intl.editableLabel}}
18+
</span>
1319
<mat-icon *ngSwitchDefault>{{_getDefaultTextForState(state)}}</mat-icon>
1420
</ng-container>
1521
</div>

src/material/stepper/stepper-intl.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export class MatStepperIntl {
2121

2222
/** Label that is rendered below optional steps. */
2323
optionalLabel: string = 'Optional';
24+
25+
/** Label that is used to indicate step as completed to screen readers. */
26+
completedLabel: string = 'Completed';
27+
28+
/** Label that is used to indicate step as editable to screen readers. */
29+
editableLabel: string = 'Editable';
2430
}
2531

2632

tools/public_api_guard/material/stepper.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ export interface MatStepperIconContext {
184184
// @public
185185
export class MatStepperIntl {
186186
readonly changes: Subject<void>;
187+
completedLabel: string;
188+
editableLabel: string;
187189
optionalLabel: string;
188190
// (undocumented)
189191
static ɵfac: i0.ɵɵFactoryDeclaration<MatStepperIntl, never>;

0 commit comments

Comments
 (0)