-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Adding array element and then deleting first element breaks validation. BUG #707
Comments
I've spent some more time looking into this. What I've found, which may just be expected behavior, is that an array of objects is not validated on keyup validation within an insert form. If I have a schema that defines an array field containing objects, then no validation of the object's fields will occur during validation prior to form submission. If I add http://meteorpad.com/pad/AS5zqm6iWDcPkDZD8/Autoform%20Array%20Validation%20Bug So this issue may boil down to simply this: when adding a new element to an array using |
Please go to the pad above and do the following:
|
I removed my earlier comments here. I think I had under-tested. #1289 is on the right track to solve this and I updated autovalues for my array types to return _.compact(this.value) and it resolves the issue. |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Given a schema like:
If I have a simple form like:
And I add a field to the array and then delete the first array element, validators no longer run. If I make the array three elements long, and then delete the middle element, validators still run on the first element but not on the second. I've tried using the bootstrap theme as well. There seems to be a bug when the array has missing elements. The validators only run on array elements before the first missing element.
The text was updated successfully, but these errors were encountered: