Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Add support to 'disabled' prop #689

Merged
merged 2 commits into from
Jun 17, 2016
Merged

Add support to 'disabled' prop #689

merged 2 commits into from
Jun 17, 2016

Conversation

jooyunghan
Copy link
Contributor

Disabled elements will not react to interactions (hover/active/focus) and follow the :disabled pseudo-class style.

<input disabled style={{':hover': ..., ':disabled': ...}}>

@coveralls
Copy link

coveralls commented Apr 27, 2016

Coverage Status

Coverage decreased (-0.3%) to 96.179% when pulling f297655 on jooyunghan:master into 2a0ed35 on FormidableLabs:master.

@@ -49,6 +49,7 @@ class TwoSquares extends React.Component {
<div>
<div key="one" style={[squareStyles.both, squareStyles.one]} />
<div key="two" style={[squareStyles.both, squareStyles.two]} />
<div key="three" disabled style={[squareStyles.both, squareStyles.three]} />
Copy link
Contributor

@jeffrifwald jeffrifwald Jun 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 177 and here, let's call that style all instead of both since there are three now.

@jeffrifwald
Copy link
Contributor

Looking good. I just had a few style-related comments.

@coveralls
Copy link

coveralls commented Jun 17, 2016

Coverage Status

Coverage decreased (-0.2%) to 96.26% when pulling 44764ec on jooyunghan:master into 2a0ed35 on FormidableLabs:master.

@alexlande
Copy link
Contributor

Thanks @jooyunghan + @jmcriffey!

@alexlande alexlande merged commit 8edd5d2 into FormidableLabs:master Jun 17, 2016
@dancherb
Copy link

dancherb commented Oct 20, 2018

I have a custom "disable handling" where I set e.g. opacity 0.5 on a component (and disable interactions) and Radium doesn't handle this - a component stays on the :hover state if it's been made active and then disabled, until you roll over it again (so it seems like e.g. lots of components are "selected" when lots are actually just stuck). Is there a workaround/fix for this?

Edit: a fix I've just found is to pass in a "key" prop with any important values that might change (i.e. my "enable button" var), causing a re-render when anything changes. This does mess up any animations though so not ideal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants