Skip to content

Commit

Permalink
fix(slide-toggle): focus ripple not hiding after click/touch
Browse files Browse the repository at this point in the history
Similarly to the checkbox (#13295), the persistent ripple should only show up for focus if the slide-toggle has been focused through keyboard.

https://storage.googleapis.com/spec-host-backup/mio-design%2Fassets%2F1w3KOMo81gakKP7JC6yNogxCt-CadYQvx%2Fslidercontrols-1a-v02.mp4
  • Loading branch information
devversion committed Nov 8, 2018
1 parent ba31c72 commit 9251451
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/slide-toggle/slide-toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
opacity: 0.04;
}

.mat-slide-toggle.cdk-focused & {
// As per specifications, the focus ripple should only show up if the slide-toggle has
// been focused through keyboard. We cannot account for `cdk-program-focused` because clicking
// on the label causes the focus origin to be `program` due to the focus redirection.
.mat-slide-toggle.cdk-keyboard-focused & {
opacity: 0.12;
}

Expand Down

0 comments on commit 9251451

Please sign in to comment.