Skip to content

Conversation

sjarva
Copy link

@sjarva sjarva commented Jan 16, 2020

Add custom onHoverColor, offHoverColor, onHoverHandleColor and offHoverHandleColor as optional props. Fixes #61

@sjarva sjarva requested a review from markusenglund January 28, 2020 06:47
@markusenglund
Copy link
Owner

Hi, sorry for not responding earlier.

When dragging the handle of the switch, the color flickers when the handle goes to either end of the switch (Chrome 87, Ubuntu).
react-switch-flicker
Regardless of whether that can be fixed, I'm not sure I will accept this PR. Expanding the API with four new props for a small feature is probably not worth it. I'm open to changing my mind about it.

Currently, you can do hover styles with CSS although it's a bit hacky and I don't you can vary it depending on checked state.

.react-switch:hover .react-switch-bg {
  background: red;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add onHoverColor and offHoverColor as props

2 participants