react-validation icon indicating copy to clipboard operation
react-validation copied to clipboard

onChange's behaviour is different from onBlur's

Open rexwang opened this issue 8 years ago • 0 comments

@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.

rexwang avatar Nov 08 '16 03:11 rexwang