Skip to content

Commit

Permalink
fix(switch): misaligned handle when inside some flex containers
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 386654956
  • Loading branch information
asyncLiz authored and Copybara-Service committed Jul 24, 2021
1 parent 3f36ac7 commit ea1e1b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions packages/mdc-switch/_switch-theme.scss
Expand Up @@ -653,7 +653,5 @@ $forced-colors-theme: (
}

@mixin _track-width($width) {
.mdc-switch__track {
@include theme.property(width, $width);
}
@include theme.property(width, $width);
}
3 changes: 3 additions & 0 deletions packages/mdc-switch/_switch.scss
Expand Up @@ -105,6 +105,7 @@ $ripple-target: '.mdc-switch__ripple';
}

@mixin root() {
align-items: center;
background: none;
border: none;
display: inline-flex;
Expand All @@ -122,6 +123,7 @@ $ripple-target: '.mdc-switch__ripple';
@mixin track() {
overflow: hidden;
position: relative;
width: 100%;

&::before,
&::after {
Expand Down Expand Up @@ -174,6 +176,7 @@ $ripple-target: '.mdc-switch__ripple';
// pointer events.
pointer-events: none;
position: absolute;
top: 0; // Needed for IE11
transition: animation.standard(transform, $animation-duration);
// IE11 needs explicit left/right
@include rtl.reflexive(left, 0, right, auto);
Expand Down

0 comments on commit ea1e1b8

Please sign in to comment.