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

Invalid form instance when extending DVR validator #579

Open
Nodios opened this issue Jun 2, 2021 · 1 comment
Open

Invalid form instance when extending DVR validator #579

Nodios opened this issue Jun 2, 2021 · 1 comment
Labels

Comments

@Nodios
Copy link
Contributor

Nodios commented Jun 2, 2021

If you have multiple forms instantiated, custom DVR rules registered, and if you pass in form instance to the rules, once validation kicks in, rules will receive invalid form instance. E.g. they will receive the instance of form that was last instantitated.

Reproduction: https://stackblitz.com/edit/react-ybjhpf

See rules.js and inspect "form" property values.

@foxhound87
Copy link
Owner

This is related to validatorjs. When you register new rules you are actually overriding the rule using the second form instance. I dont't know if this can be fixed due to the validatorjs lib limitation.

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

No branches or pull requests

2 participants