Skip to content

Commit ecf8b0d

Browse files
crisbetojelbourn
authored andcommitted
fix(button-toggle): clickable area not stretching when custom width is set (#12642)
Fixes the button toggle's clickable area not stretching, if the element is stretched beyond its initial width. Fixes #8432.
1 parent 8fdc2cf commit ecf8b0d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lib/button-toggle/button-toggle.scss

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ $mat-button-toggle-border-radius: 2px !default;
3535
}
3636
}
3737

38-
.mat-button-toggle-disabled .mat-button-toggle-label-content {
39-
cursor: default;
40-
}
41-
4238
.mat-button-toggle {
4339
white-space: nowrap;
4440
position: relative;
@@ -65,7 +61,6 @@ $mat-button-toggle-border-radius: 2px !default;
6561
display: inline-block;
6662
line-height: $mat-button-toggle-height;
6763
padding: $mat-button-toggle-padding;
68-
cursor: pointer;
6964
}
7065

7166
.mat-button-toggle-label-content > * {
@@ -112,4 +107,10 @@ $mat-button-toggle-border-radius: 2px !default;
112107
margin: 0;
113108
font: inherit;
114109
outline: none;
110+
width: 100%; // Stretch the button in case the consumer set a custom width.
111+
cursor: pointer;
112+
113+
.mat-button-toggle-disabled & {
114+
cursor: default;
115+
}
115116
}

0 commit comments

Comments
 (0)