Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 0b2ab83

Browse files
Googlernshahan
authored andcommitted
[a11y] Applies disabled to stepper items that cannot be selected so they cannot be tabbed to. Items that are tabbable will leverage existing styling when focused.
PiperOrigin-RevId: 221189533
1 parent 7ce8b13 commit 0b2ab83

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

angular_components/lib/material_stepper/material_stepper.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
[class.can-select]="step.isSelectable"
1717
attr.active="{{step.active}}"
1818
attr.selectable="{{step.isSelectable}}"
19+
[disabled]="step.isNotSelectable"
1920
buttonDecorator
2021
(trigger)="jumpStep(step.index)">
2122
<!-- Step number in circle -->

angular_components/lib/material_stepper/material_stepper.scss

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ $edit-icon-size: $mat-grid * 2;
110110
outline-width: 0;
111111
position: relative;
112112

113+
&[selectable = true]:focus {
114+
background-color: $mat-grey-200;
115+
116+
.edit-icon {
117+
color: $mat-grey-700;
118+
}
119+
}
120+
113121
&[orientation = horizontal] {
114122
display: flex;
115123
flex-direction: row;
@@ -118,19 +126,6 @@ $edit-icon-size: $mat-grid * 2;
118126
&[orientation = vertical] {
119127
padding-bottom: $mini-spacing;
120128
width: auto;
121-
122-
&[active = false] {
123-
124-
&[selectable = true] {
125-
&:hover {
126-
background-color: $mat-grey-200;
127-
}
128-
129-
&:hover .edit-icon {
130-
color: $mat-grey-700;
131-
}
132-
}
133-
}
134129
}
135130
}
136131

0 commit comments

Comments
 (0)