bietkul / react-reactive-form

Angular like reactive forms in React.
MIT License
309 stars 32 forks source link

Switch component don't update touched property #49

Open GrzegorzStanczyk opened 5 years ago

GrzegorzStanczyk commented 5 years ago

Describe the bug When we touch or change Switch value. Touched property don't change.

To Reproduce Steps to reproduce the behavior:

  1. Change Switch value
  2. Check form control touched property
  3. It still have false value

Expected behavior Touched value should change to true on first control touch.

Desktop (please complete the following information):

bietkul commented 5 years ago

Can you please give me more info, like which version you're using & what is the platform i.e React-Native or React?

GrzegorzStanczyk commented 5 years ago

Sorry, I did not specify. React Native 0.59.10. And ios xcode iPhoneX 12.2 simulator. Switch native component <Switch label={label} style={styles.switch} {...props} {...handler('switch')} />

bietkul commented 5 years ago

Thanks, I'll get back to you soon. Meanwhile, you can try to call markAsTouched method to register the touch event on onBlur in Switch.