Skip to content
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] selected item color is pink while styles are set to other color #4481

Closed
liesislukas opened this issue Jun 13, 2016 · 5 comments
Labels
component: select This is the name of the generic UI component, not the React module!

Comments

@liesislukas
Copy link
Contributor

Problem description

selected item has pink color even if it has extra styles setting color.

image

when collapsed coloring is correct:

image

Steps to reproduce

 <SelectField
              labelStyle={{color: orange500}}
              ...
            >
              <MenuItem value={1} key={1} primaryText={'low'} style={{color: green500}}/>
              <MenuItem value={2} key={2} primaryText={'medium'} style={{color: orange500}}/>
              <MenuItem value={3} key={3} primaryText={'high'} style={{color: red500}}/>
            </SelectField>

Versions

  • Material-UI: 0.15.0
  • React: 15.1.0
  • Browser: Chrome: Version 51.0.2704.84 (64-bit)
@ghost
Copy link

ghost commented Jul 22, 2016

I had the same problem and to fix it I simply modified the muiTheme

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
const muiTheme = getMuiTheme({
    palette: {
        accent1Color: 'rgb(0, 84, 129)',
        secondary2color: "rgb(0, 84, 129)"
    },
});

render(){
       return (
             <MuiThemeProvider muiTheme={muiTheme}>
                   ................
            </MuiThemeProvider>
       )
}

@liesislukas
Copy link
Contributor Author

liesislukas commented Jul 25, 2016

Will it make a lot of side effects on other elements too? Is it possible to wrap single element with MuiThemeProvider to have diff theme then all other elements on app?

@ghost
Copy link

ghost commented Jul 25, 2016

You wrap it on a single Component if you don't want it to mess with your whole application.

@mpontikes mpontikes mentioned this issue Aug 5, 2016
13 tasks
@aahan96
Copy link
Contributor

aahan96 commented Aug 11, 2016

@liesislukas This is done so that the selected option is known. I don't think the selected item should retain it's color

@liesislukas
Copy link
Contributor Author

@aahan96 there should be an option for that or workaround documented what @davidebarros mentioned here

@oliviertassinari oliviertassinari added the component: select This is the name of the generic UI component, not the React module! label Mar 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

3 participants