Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formsy.addValidationRule value is "one state behind" #454

Open
jjsub opened this issue Jun 12, 2017 · 1 comment
Open

Formsy.addValidationRule value is "one state behind" #454

jjsub opened this issue Jun 12, 2017 · 1 comment

Comments

@jjsub
Copy link

jjsub commented Jun 12, 2017

I'm trying to set a custom validation to this input. See the code"

Formsy.addValidationRule('someName', (values, value, otherValue) => {
	return value.length === 0 || value.length === 9;
});

But value is one state behind the input state. there is a way to get the value to be the current value in the input box?

@dviry
Copy link

dviry commented Aug 9, 2018

I've had the same issue but it's not actually related to the validations. I'd suggest reviewing how/when you are calling .setValue() and .getValue() - when those are not correctly setup you'll experience exactly this side-effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants