-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SelectField] How to change/override "color" style of selected option of SelectField ? #3388
Comments
At this moment, you can only change the |
You can change the color of the selected text like this: import getMuiTheme from 'material-ui/lib/styles/getMuiTheme';
const muiTheme = getMuiTheme({}, {
menuItem: {
selectedTextColor: 'white',
},
}); But in your case, you want to change the color of the text field, use |
Hi, just found out about is there a reason why this is not possible/implemented? many thanks |
@wzup were you able to get this going ? |
Did you try labelStyle? <SelectField labelStyle={{ color: 'green' }} /> |
how do you get rid of the underline on these components....geeze louise. |
as @thomasmery said:
thats solved in #5379 with that you can just set the 'selectedTextColor' on the compiled theme (before injecting it into the context) const muiTheme = getMuiTheme(myBaseTheme)
muiTheme.menuItem.selectedTextColor = '#BADA55' i would prepare a PR for a 'labelSelectedStyle' if i got the OK/Feedback and time. |
The initial question does not seem to be answered yet? How can we change the color of the selected option, as @wzup asked and described in detail?
has no effect, when using a SelectField.
changes the color within to flyover list, when the user has opened the SelectField. But the selected option, which is displayed, when the SelectField is closed (see screenshot) has still the old color. IMHO there is no clear solution from the answers above or I just don't get it ;) |
The question has been answered by @aaronboss, thanks! |
@oliviertassinari Thanks for the heads-up! labelStyle is working! |
@oliviertassinari link is not working. |
@oliviertassinari dead link bro |
@noneuf we are now working on v1-beta. You can always ask on StackOverflow. |
const theme = createMuiTheme({
overrides: {
MuiSelect: {
select: {
"&:focus": {
background: "#3A3660"
},
color:'white'
}
},
}
}); |
I cannot override
color
style for selected option. It is always black:I have set all possible related style options and neither works.
How do you override
color
?The text was updated successfully, but these errors were encountered: