Skip to content

Commit

Permalink
[Switch] Fix rendering in IE 11 and Safari (#17095)
Browse files Browse the repository at this point in the history
* Fixes - Poor switch animation in mobile safari

* Circle CI - small patch

* fix rendering of the demos
  • Loading branch information
rbrishabh authored and oliviertassinari committed Aug 22, 2019
1 parent 4f10bf7 commit 343ae8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/src/pages/components/switches/CustomizedSwitches.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const IOSSwitch = withStyles(theme => ({
switchBase: {
padding: 1,
'&$checked': {
transform: 'translateX(16px)',
color: theme.palette.common.white,
'& + $track': {
backgroundColor: '#52d869',
Expand Down Expand Up @@ -84,6 +85,7 @@ const AntSwitch = withStyles(theme => ({
padding: 2,
color: theme.palette.grey[500],
'&$checked': {
transform: 'translateX(12px)',
color: theme.palette.common.white,
'& + $track': {
opacity: 1,
Expand Down
2 changes: 2 additions & 0 deletions docs/src/pages/components/switches/CustomizedSwitches.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const IOSSwitch = withStyles(theme => ({
switchBase: {
padding: 1,
'&$checked': {
transform: 'translateX(16px)',
color: theme.palette.common.white,
'& + $track': {
backgroundColor: '#52d869',
Expand Down Expand Up @@ -92,6 +93,7 @@ const AntSwitch = withStyles(theme => ({
padding: 2,
color: theme.palette.grey[500],
'&$checked': {
transform: 'translateX(12px)',
color: theme.palette.common.white,
'& + $track': {
opacity: 1,
Expand Down
4 changes: 1 addition & 3 deletions packages/material-ui/src/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ export const styles = theme => ({
transition: theme.transitions.create(['left', 'transform'], {
duration: theme.transitions.duration.shortest,
}),
willChange: 'left, transform',
'&$checked': {
left: '100%',
transform: 'translateX(-100%)',
transform: 'translateX(50%)',
},
'&$disabled': {
color: theme.palette.type === 'light' ? theme.palette.grey[400] : theme.palette.grey[800],
Expand Down

0 comments on commit 343ae8e

Please sign in to comment.