From ecf8b0d9f026fa3c067dcb7a35226066fa562fc6 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 21 Aug 2018 20:49:27 +0200 Subject: [PATCH] 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. --- src/lib/button-toggle/button-toggle.scss | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/button-toggle/button-toggle.scss b/src/lib/button-toggle/button-toggle.scss index e1b9c69ab1e..92725079af9 100644 --- a/src/lib/button-toggle/button-toggle.scss +++ b/src/lib/button-toggle/button-toggle.scss @@ -35,10 +35,6 @@ $mat-button-toggle-border-radius: 2px !default; } } -.mat-button-toggle-disabled .mat-button-toggle-label-content { - cursor: default; -} - .mat-button-toggle { white-space: nowrap; position: relative; @@ -65,7 +61,6 @@ $mat-button-toggle-border-radius: 2px !default; display: inline-block; line-height: $mat-button-toggle-height; padding: $mat-button-toggle-padding; - cursor: pointer; } .mat-button-toggle-label-content > * { @@ -112,4 +107,10 @@ $mat-button-toggle-border-radius: 2px !default; margin: 0; font: inherit; outline: none; + width: 100%; // Stretch the button in case the consumer set a custom width. + cursor: pointer; + + .mat-button-toggle-disabled & { + cursor: default; + } }