Skip to content

Commit

Permalink
[TextField] Improve WCAG 2.4.7 with error={true} (#35687)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 3, 2023
1 parent a267ed6 commit bc28242
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions packages/mui-material/src/FilledInput/FilledInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ const FilledInputRoot = styled(InputBaseRoot, {
'&:before, &:after': {
borderBottomColor: (theme.vars || theme).palette.error.main,
},
'&:focus-within:after': {
transform: 'scaleX(1)', // error is always underlined in red
},
},
'&:before': {
borderBottom: `1px solid ${
Expand Down
5 changes: 1 addition & 4 deletions packages/mui-material/src/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ const InputRoot = styled(InputBaseRoot, {
'&:before, &:after': {
borderBottomColor: (theme.vars || theme).palette.error.main,
},
'&:focus-within:after': {
transform: 'scaleX(1)', // error is always underlined in red
},
},
'&:before': {
borderBottom: `1px solid ${bottomLineColor}`,
Expand All @@ -97,7 +94,7 @@ const InputRoot = styled(InputBaseRoot, {
pointerEvents: 'none', // Transparent to the hover style.
},
[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]: {
borderBottom: `1px solid ${(theme.vars || theme).palette.text.primary}`,
borderBottom: `2px solid ${(theme.vars || theme).palette.text.primary}`,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
borderBottom: `1px solid ${bottomLineColor}`,
Expand Down

0 comments on commit bc28242

Please sign in to comment.