Skip to content

Commit 70aca02

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 13f1c6e commit 70aca02

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 > * {
@@ -110,4 +105,10 @@ $mat-button-toggle-border-radius: 2px !default;
110105
margin: 0;
111106
font: inherit;
112107
outline: none;
108+
width: 100%; // Stretch the button in case the consumer set a custom width.
109+
cursor: pointer;
110+
111+
.mat-button-toggle-disabled & {
112+
cursor: default;
113+
}
113114
}

0 commit comments

Comments
 (0)