diff --git a/packages/mui-material/src/Switch/Switch.js b/packages/mui-material/src/Switch/Switch.js index 6a8d98161c51b3..18e426989a38b5 100644 --- a/packages/mui-material/src/Switch/Switch.js +++ b/packages/mui-material/src/Switch/Switch.js @@ -194,6 +194,8 @@ const SwitchTrack = styled('span', { height: '100%', width: '100%', borderRadius: 14 / 2, + boxSizing: 'border-box', + border: '1px solid transparent', zIndex: -1, transition: theme.transitions.create(['opacity', 'background-color'], { duration: theme.transitions.duration.shortest, @@ -214,6 +216,8 @@ const SwitchThumb = styled('span', { memoTheme(({ theme }) => ({ boxShadow: (theme.vars || theme).shadows[1], backgroundColor: 'currentColor', + boxSizing: 'border-box', + border: '1px solid transparent', width: 20, height: 20, borderRadius: '50%', diff --git a/test/regressions/fixtures/Switch/SimpleSwitch.js b/test/regressions/fixtures/Switch/SimpleSwitch.js new file mode 100644 index 00000000000000..7b339a684d45cf --- /dev/null +++ b/test/regressions/fixtures/Switch/SimpleSwitch.js @@ -0,0 +1,12 @@ +import Switch from '@mui/material/Switch'; + +const label = { slotProps: { input: { 'aria-label': 'Switch demo' } } }; + +export default function BasicSwitches() { + return ( +