You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Observables within observable arrays which are "required" are passing validation even if they are undefined or empty.
To reproduce the issue, please see this JSFiddle. I have a form which collects information about dogs' names and breeds. The "Dog Breed" field is required. Also note that I have followed the examples here on how to validate nested values.
functionKnockoutViewModel(){varself=this;self.dogs=ko.observableArray([newDog()]);self.submitForm=function(){console.log(self.dogs()[0].Breed());};self.validationObject=ko.validatedObservable({dogs: self.dogs});}functionDog(){varself=this;self.Name=ko.observable();self.Breed=ko.observable().extend({required: {params: true,message: "The dog's breed field is required."}});self.validationObject=ko.validatedObservable({Breed: self.Breed.extend({required: true})});}
To reproduce the issue:
Submit the form without a value in the "Dog Breed" field. validation successful
Enter a value into the "Dog Breed" field, delete it, and re-submit the form. validation successful
Enter a value into the "Dog Breed" field, submit the form, delete the value again, and resubmit the form. validation failed
I would expect (3) but not (1) and (2). Is this the intended behavior?
Note: I originally encountered this issue and described it in #636, but I'd initially missed the part of the documentation that states that special configuration is required to validate observables within observable arrays.
The text was updated successfully, but these errors were encountered:
Observables within observable arrays which are "required" are passing validation even if they are undefined or empty.
To reproduce the issue, please see this JSFiddle. I have a form which collects information about dogs' names and breeds. The "Dog Breed" field is required. Also note that I have followed the examples here on how to validate nested values.
To reproduce the issue:
I would expect (3) but not (1) and (2). Is this the intended behavior?
Note: I originally encountered this issue and described it in #636, but I'd initially missed the part of the documentation that states that special configuration is required to validate observables within observable arrays.
The text was updated successfully, but these errors were encountered: