Description
If an additional item is added to an array
input field then it initially has the classes form-control
, ng-invalid
, ng-invalid-tv4-302
, ng-empty
, ng-invalid-schema-form
, ng-touched
, but I was expecting it to have form-control
, ng-empty
, ng-valid-schema-form
, ng-touched
.
Here is a Plunker showing this; just add an additional item to the array and it will immediately be in an invalid state.
Interestingly this doesn't seem to be the case for the array example on the demo site. This behaves as I would expect it to, I have a feeling this is using the version of the bootstrap decorators prior to them being moved to a separate repository and hence something seems to have changed in the latest version.
Also, this may or may not be related, but as soon as a second item is added to the array a Required
validation message appears for the entire array object. This sort of makes sense given that the second item is invalid, but if I then remove the second item this validation message remains. Further still if I remove the first item then the Required
validation message disappears, which is not what I would expect given that the comments
item is required as part of the JSON schema and is now completely empty, so I would expect the required
validation to trigger at this point.