mui / material-ui

Material UI: Comprehensive React component library that implements Google's Material Design. Free forever.
https://mui.com/material-ui/
MIT License
93.87k stars 32.26k forks source link

Select component does not respect `disabled` styles #17794

Closed cdcasey closed 5 years ago

cdcasey commented 5 years ago

The Select components show a dotted underline when disabled. There appears to be no way to change this styling.

Current Behavior 😯

The bottom border stays dotted no matter what I try.

Expected Behavior 🤔

The bottom border should change according to specified styling.

Steps to Reproduce 🕹

1) Create a select component 2) Specify that the component is disabled 3) Style the disabled state with classes={{ disabled: classes. }}

https://codesandbox.io/s/material-demo-kiws1

Steps:

  1. Simply load the demo and you should see the bug. The Select component is disabled and the CSS is there and not being recognized.

Unrelated, I tried to delete that second Select component, but got a CORS error when doing so. I have no idea what's going on there.

Context 🔦

I would like to style this component reliably in all states.

Your Environment 🌎

Tech Version
Material-UI v4.5.0
React 16.10.2
Browser Latest Chrome & Firefox
eps1lon commented 5 years ago

You need to increase the specificity. More about this topic under https://material-ui.com/customization/components/#pseudo-classes

cdcasey commented 5 years ago

As we're using JSS I tried this:

https://material-ui.com/customization/components/#use-rulename-to-reference-a-local-rule-within-the-same-style-sheet

But nothing overrides the .MuiInput-underline.Mui-disabled::before class that defines that bottom border.