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

RaisedButton sets incorrect style when dynamically updating disabled state #837

Closed
joewalker opened this issue Jun 13, 2015 · 3 comments
Closed
Labels
component: button This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.

Comments

@joewalker
Copy link

I have a form which disables the 'save' button when any of the fields are invalid, however the color of the save button is out of sync with its state. It correctly can't be pressed when disabled, and the zIndex is right too, however the color is wrong.

I did some digging and it looks like the problem might be that RaisedButton.componentWillReceiveProps calls getStyles(), but getStyles reads from this.props which clearly isn't up to date at this point.
Perhaps the call to this.styles = this.getStyles(); should be delayed until render() or something?

@joewalker
Copy link
Author

If we agree on a fix, I'll do a PR.

@hai-cea
Copy link
Member

hai-cea commented Jun 13, 2015

Sounds good - thanks @joewalker !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

No branches or pull requests

4 participants