RaisedButton sets incorrect style when dynamically updating disabled state #837
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.
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
callsgetStyles()
, but getStyles reads fromthis.props
which clearly isn't up to date at this point.Perhaps the call to
this.styles = this.getStyles();
should be delayed untilrender()
or something?The text was updated successfully, but these errors were encountered: