NewOldMax / react-form-validator-core

Core validator component for react forms
MIT License
95 stars 44 forks source link

How can I handle multiple input component ? #52

Closed ajallon-sqli closed 5 years ago

ajallon-sqli commented 5 years ago

Hi guys, first thank you for your work. Your package is the only one that covered all my uses cases... Until now. I'm trying to make a Radio ValidatorComponent (RadioGroupValidator) that contain some Radio components (<input type="radio" {...props} />). I use the "required" rule with an error message as it is a radio (I just want to check if at least on radio has been checked). The problem is that when i submit my form, the error appears event if one of my radio is checked. I make the error disappear with the "makeValid" methode of ValidatorComponent but when validation is call it still returns an error.

TL;DR:

NewOldMax commented 5 years ago

Hi, can you reproduce your issue at https://codesandbox.io/s/new ?

ajallon-sqli commented 5 years ago

Here is it: https://codesandbox.io/s/hopeful-sea-x8t64

NewOldMax commented 5 years ago

Try this one https://codesandbox.io/s/f64c7

ajallon-sqli commented 5 years ago

Thank you for the fast answer, didn't thought about that solution it's awesome ^^