When I set InputLabel with shrink={true} and FormControl is outlined, The InputLabel background is not correct
The background of InputLabel (shrink={true}) when use FormControl (variant="outlined") is transparent ( not 'white' as expected )
When I use InputLabel ( shrink={true} ) when use FormControl ( variant="outlined" ), the background of InputLabel shoud be 'white'
Steps:
Link Codesandbox: https://codesandbox.io/s/material-demo-4dtlw
'white')
I trying to use shrink={true} and variant="outlined" with the Select, but the css is not correct.
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.10.0 |
| React | v16.8.6 |
| Browser | |
馃憢 Thanks for using Material-UI!
We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.
For support, please check out https://material-ui.com/getting-started/support/. Thanks!
If you have a question on StackOverflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.
@thaind97git You need to tell the select that the notch should be "open".
After a few hours of frustration I finally found the (hopefully correct) solution:
<FormControl variant="outlined">
<InputLabel shrink>{label}</InputLabel>
<Select input={<OutlinedInput notched label={label} />} />
</FormControl>
I suggest adding such an example to the documentation, considering I found dozens of issues and/or questions related to the same problem, with no actual working answer though.
This is really confusing especially for someone who just started using material-ui - why it's needed to pass label prop explicitly to OutlinedInput, when we already passed it to FormControl and InputLabel (and it didn't change a thing)...
Most helpful comment
After a few hours of frustration I finally found the (hopefully correct) solution:
I suggest adding such an example to the documentation, considering I found dozens of issues and/or questions related to the same problem, with no actual working answer though.
This is really confusing especially for someone who just started using
material-ui- why it's needed to passlabelprop explicitly toOutlinedInput, when we already passed it toFormControlandInputLabel(and it didn't change a thing)...