react-native-material-kit
react-native-material-kit copied to clipboard
Problem with style in Switch
Hi, I have an issue when I change the status of switch It show a few seconds with bad style format. Like this:
Anyone know how to solve this?
I'm working with RN 0.26.2 and RMMK 0.3.2 (IOS)
Thanks!
Can you try with the master branch? I know I fixed a bug with State & Switch few weeks ago but not released yet.
@Crash-- Hi, I'm having a problem with Switches as well. How do I use the master branch, do I just use the git repo as my target for npm?
i.e. npm i -S xinthink/react-native-material-kit#master
I can confirm master
fixes my problem, it was around getThumb()
returning null when trying the toggle the checked state of the Switch. 🔧
@Crash-- Unfortunately master
does not fix this problem 😢
Steps to reproduce:
- Render a switch with
<MKSwitch checked={false} />
- Update the switch so checked is now true programmatically (i.e. don't update by clicking) - the thumb won't move but will change colour.
<MKSwitch checked={true} />
- Click the thumb to toggle the switch off - the switch will move left of the track.
The opposite can be done for the other side quite easily.
I have the same graphical issue and it appears regardless of whether I set checked via a prop
Nevermind it doesn't happen when I don't have onPress set
Seems to be an issue with the animation as it doesn't occur with onCheckedChange
but happens with onPress
. using onCheckedChange
doesn't animate the switch though.