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

Bug: Toggling the disabled prop on RaisedButton triggers incorrect transitions #702

Closed
cdax opened this issue May 28, 2015 · 0 comments · Fixed by #731 or mui/base-ui#577
Closed
Labels
component: button This is the name of the generic UI component, not the React module! component: switch This is the name of the generic UI component, not the React module!

Comments

@cdax
Copy link

cdax commented May 28, 2015

The componentWillReceiveProps on RaisedButton makes the zDepth transition based on nextProps, while all other styles are set based on the values of the current props. e.g., here (called from within componentWillReceiveProps > getStyles)

As a result, when the disabled prop goes from false to true, the button has its z-index set to 1 but the color remains grey. Similarly, when disabled goes from true to false, the button gets a z-index of 0 and the default (or primary or secondary) color.

pomerantsev added a commit to pomerantsev/material-ui that referenced this issue Jun 1, 2015
Fixes mui#702

Raised-button was made unnecessarily more stateful by introducing
this.style. This way, the styles were calculated at the wrong moment
(in componentWillReceiveProps instead of render).
mnajdova pushed a commit to mnajdova/material-ui that referenced this issue Nov 10, 2020
…e-dependencies

Rosskevin feature/update dependencies
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: switch This is the name of the generic UI component, not the React module! component: button This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
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! component: switch This is the name of the generic UI component, not the React module!
Projects
None yet
3 participants