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

[FontIcon] Will be broken if you pass a color in the style prop #4692

Closed
chrisnojima opened this issue Jul 12, 2016 · 1 comment
Closed

[FontIcon] Will be broken if you pass a color in the style prop #4692

chrisnojima opened this issue Jul 12, 2016 · 1 comment
Labels
component: Icon The React component.

Comments

@chrisnojima
Copy link

Problem description

If you do

<FontIcon style={{color: 'red'}} hoverColor='green'/>

you'll see hoverColor is never used. This is because https://github.com/callemall/material-ui/blob/master/src/FontIcon/FontIcon.js#L99 does

style={prepareStyles(Object.assign(styles.root, style))}

styles.root is computed and will have the correct color based on state (green) but if you pass in color as a style prop it'll then promptly blow it away (same if you pass in color as a prop also).

Maybe it should give you a warning if you pass in a color prop to this component?

Steps to reproduce

Versions

  • Material-UI: 15.x
  • React: 15.x
  • Browser: All
@mpontikes mpontikes mentioned this issue Aug 5, 2016
13 tasks
@oliviertassinari oliviertassinari added the component: Icon The React component. label May 16, 2017
@oliviertassinari oliviertassinari changed the title FontIcon will be broken if you pass a color in the style prop [FontIcon] Will be broken if you pass a color in the style prop May 16, 2017
@oliviertassinari
Copy link
Member

We have been porting the component on the v1-beta branch. We reimplemented it from the ground-up. While we haven't tested it, I think that the issue is most likely fixed on that branch. Hence, I'm closing it.
Still, we will accept PR fixes until v1-beta takes over the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Icon The React component.
Projects
None yet
Development

No branches or pull requests

2 participants