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

If default value is kept as true than switch shows inactive mode. #5

Open
jiteshwadia opened this issue Aug 16, 2017 · 4 comments
Open

Comments

@jiteshwadia
Copy link

Hi,

Issue:
If default value is kept true than switch shows inactive mode and no inactive text appears. After you change the value than it start working.

Switch works fine if default value is kept as false.

@ShaunEvening
Copy link
Contributor

Hi @jiteshwadia,

I had the same issue. A pull request was just merged in yesterday that should resolve this issue for you. If you haven't already, check out the latest version. The defaultValue prop has been replaced with value so that the switches toggle state can be handled by a parent component.

I've also updated the README.md with a new example to reflect the changes and table of all the available props. I hope this helps and if not feel free to message me

@jiteshwadia
Copy link
Author

Thanks @ShaunLloyd . There is one more issue which is happening after the change.

Issue :
If you pass value={true} to switch, than it shows the proper activeBGColor. But It doesn't show activeText. The activeText appears after you click on that switch & also, the switch stays in activeMode.
After the first valueChange event the switch gets corrected & than it starts working properly.

If you pass value={false} it works as expected.

@ShaunEvening
Copy link
Contributor

@jiteshwadia that's interesting... I'll take a peek at soon. Any code snippets you can share in the mean time?

@bressa97
Copy link

same problem here @ShaunLloyd

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

No branches or pull requests

3 participants