markusenglund / react-switch

A draggable toggle-switch component for React. Check out the demo at:
https://react-switch.netlify.com/
MIT License
1.33k stars 100 forks source link

Disabled - not changing the style. #12

Closed juanpmarengo closed 6 years ago

juanpmarengo commented 6 years ago

Expected behaviour: disabling the action without changing it's color to grey. Is there a way to achieve this? Thanks in advance.

markusenglund commented 6 years ago

It's a bit of a hack, but you could do this:

Give the switch a className

<Switch
  className="react-switch"
  // Other props
/>

Then override the opacity-styling in css

.react-switch {
  opacity: 1 !important;
}

Hope that helps!

juanpmarengo commented 6 years ago

It works! Thanks!