Closed bogdansoare closed 6 years ago
@kavink thanks for the link, but that still doesn't solve my issue.
@erikras any thoughts on this?
Well reported, @bogdansoare. Will investigate... 🔍
Upgrading from redux-form, I tried how its referenced here https://redux-form.com/6.7.0/examples/fieldarrays/, ie change the array to an object and use _error property.
Unfortuately that didnt work
@djeeg Try this:
import { ARRAY_ERROR } from 'final-form'
...
errors.myArray = []
errors.myArray[ARRAY_ERROR] = 'Error for the whole array'
Ahh I just found your latest PR with ARRAY_ERROR https://github.com/final-form/final-form/pull/92
Trying it here: https://codesandbox.io/s/kmr4zj22z5
Though still get it to trigger an error
EDIT
Got it, thanks
@erikras did you have time to check array field-level validation ?
No, but this is high on my list of examples to create, so it will get done soon.
@erikras sorry to bother you again, any progress on this?
Thanks for the nudge, @bogdansoare. 👍
awesome, thank you very much ❤️
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I've tried implementing array field-level validation but I get the following error when I try to delete the last item in the array
Cannot set a numeric property on an object
.I would like to validate the
FieldArray
and also each subfield in the array.Link to the codesandox .
As a side note I've also took a look at https://github.com/final-form/final-form/issues/35 but the proposed solution with record-level validation isn't working with the latest versions of the library https://codesandbox.io/s/2pnv1x052y Also I find record-level validation much more repetitive and kind of unusable in a real app compared to having some functions for field-level validation