When a filled textfield is disabled, the underline should not change color on hover as that implies interactivity.
Underline on a disabled filled textfield darkens on mouse hover.
Underline on a disabled filled textfield should not change on mouse hover.
Steps:
See the filled textField in this example: https://codesandbox.io/s/material-demo-9vqbl
(this example is just the first example from TextField docs, with "disabled" added to the filled textField)
I've found a css workaround:
'&.Mui-disabled:hover::before': {
borderColor: 'inherit',
},
But I suspect this is a bug as the underline should not change color on hover as that implies interactivity. Standard and Outlined textFields follow this practice, as neither of them change on hover when disabled.
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.10.2 |
| React | 16.13.1 |
| Browser | Chrome |
| TypeScript | |
| etc. | |
Yeah, I can reproduce that.
diff --git a/packages/material-ui/src/FilledInput/FilledInput.js b/packages/material-ui/src/FilledInput/FilledInput.js
index 99c433918..bf3589d1f 100644
--- a/packages/material-ui/src/FilledInput/FilledInput.js
+++ b/packages/material-ui/src/FilledInput/FilledInput.js
@@ -78,7 +78,7 @@ export const styles = (theme) => {
}),
pointerEvents: 'none', // Transparent to the hover style.
},
- '&:hover:before': {
+ '&:hover:not($disabled):before': {
borderBottom: `1px solid ${theme.palette.text.primary}`,
},
'&$disabled:before': {
How about this fix?
@tchmnn Great fix, do you want to get it to the finish line :)?
Most helpful comment
Yeah, I can reproduce that.
How about this fix?