Skip to content

Cannot read property 'validators' of undefined" in final-form when change version of final-form-arrays #158

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

Open
2u4u opened this issue Feb 12, 2021 · 1 comment

Comments

@2u4u
Copy link

2u4u commented Feb 12, 2021

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

Changing version of final-form-arrays in simple example causes error "Cannot read property 'validators' of undefined" in final-form. Steps to reproduce:

  1. Open simple example from docs
  2. Change version of final-form-arrays
    - "final-form-arrays": "1.1.2",
    + "final-form-arrays": "^1.1.2",
  3. Add customer in the list
  4. Remove customer from the list with click on ❌

What is the expected behavior?

Project works properly

Sandbox Link

Simple example with changed final-form-arrays version

@ewedlund
Copy link

ewedlund commented Apr 22, 2021

Not sure if this is helpful:

I stumbled on this while having issues with react-final-form-html5-validation

In a FieldArray with field validation, if I remove any object except the last one, the validation seem to use the old object's data. E.g. I add two objects, then remove the first one, even if I insert valid data, the validation fails on exactly those fields that were not filled in for the removed object.

I was unable to create a sandbox to describe the problem because of the issue described by @2u4u, but downgrading to final-form-arrays 1.1.2, the issue with react-final-form-html5-validation went away in my project, so I suppose it is a problem in this library and not react-final-form-html5-validation.

FWIW here's the sandbox, but downgrading the library, it now works as expected: FieldArray with html5 validation

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