1. Matthew Schinckel
  2. knockout-validators

Commits

Matthew Schinckel  committed cfe3ed4

Turn off the 'don't show validation errors initially' thing.

  • Participants
  • Parent commits d9bad77
  • Branches default

Comments (0)

Files changed (1)

File src/knockout.validators.js

View file
     // the value has been changed at least once.
     // This still needs some thought, as we may need
     // to validate when _any_ values in a model change...
-    var valueNeverChanged = ko.observable(true);
-    var monitor = this.subscribe(function() {
-      valueNeverChanged(false);
-      monitor.dispose();
-    });
+    // var valueNeverChanged = ko.observable(true);
+    // var monitor = this.subscribe(function() {
+    //   valueNeverChanged(false);
+    //   monitor.dispose();
+    // });
     
     var errors = ko.computed(function(){
-      if (valueNeverChanged()) {
-        return [];
-      }
+      // if (valueNeverChanged()) {
+      //   return [];
+      // }
       var value = ko.utils.unwrapObservable(this);
       return ko.utils.arrayFilter(validatorList(), function(condition){
           return condition.validator(value, condition.testValue);