react-validation
react-validation copied to clipboard
onChange's behaviour is different from onBlur's
@Lesha-spr , I notice that the validation behaviour is different between onChange and onBlur.
I have the following code:
handleChange() {
console.log(this.form.state.errors);
}
render() {
return (
<Validation.components.Form ref={form => this.form = form}>
<Validation.components.Input className="form-control"
name="loan_amount_wanted"
validations={['required']}
onChange={this.handleChagne.bind(this)}/>
</Validation.components.Form>
);
}
When I try to get this.form.state.errors when onChange event is triggered, I always get a non empty object even the rules are passed, however, when onBlur even is triggered, I get an empty object which is expected.
Could you investigate? Thanks.