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

Nested form fields validation doesn’t get triggered with triggerValidation or on change #893

Closed
ghost opened this issue Jan 23, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jan 23, 2020

Describe the bug
We are using nested form fields (e. g. "person.firstName") in combination with yup validation schemas. The validation gets triggered on onSubmit but it doesn’t work with triggerValidation(['person.firstName', ...]). triggerValidation('person.firstName') works but the validation doesn’t get triggered when changing the fields input value.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/bold-murdock-pq8l2
  2. Click on the button "triggerValidation(nested)
  3. Open the console
  4. See errors is still an empty object

Codesandbox link
https://codesandbox.io/s/bold-murdock-pq8l2

Expected behavior
I would expect that triggerValidation works with an array with nested form field names an that onChange triggers a revalidation.

@bluebill1049 bluebill1049 added the bug Something isn't working label Jan 23, 2020
@bluebill1049
Copy link
Member

i think i may have fixed this last night: 065ab57

@bluebill1049 bluebill1049 self-assigned this Jan 23, 2020
@bluebill1049 bluebill1049 added this to In progress in React Hook Form Jan 23, 2020
bluebill1049 added a commit that referenced this issue Jan 23, 2020
@bluebill1049
Copy link
Member

can you help on testing if this beta solve the problem: react-hook-form@4.6.3-beta.3

@bluebill1049 bluebill1049 moved this from In progress to Done in React Hook Form Jan 29, 2020
@bluebill1049 bluebill1049 removed their assignment Aug 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant