Skip to content

Commit

Permalink
Merge pull request #80 from inicolenco/iss60
Browse files Browse the repository at this point in the history
Fixed issue #60
  • Loading branch information
nelsonomuto authored Sep 12, 2016
2 parents 4d85773 + e881d1d commit bac6e0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/scripts/directives/customvalidation/customValidations.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,12 @@ angular_ui_form_validations = (function(){
}
}

value = getElementValue();

//Do not validate if input is pristine, i.e nothing entered by user yet
if($element.hasClass('ng-pristine') && eventType !=='runCustomValidations'){
console.log('--- runCustomValidations not validating because pristine');
return;
return value;
}

successFn = formatterArgs.success || function(){};
Expand Down Expand Up @@ -596,7 +598,6 @@ angular_ui_form_validations = (function(){

currentlyDisplayingAnErrorMessage = currentErrorMessage.length > 0;

value = getElementValue();

if (formatterArgs.customValidationAttribute === 'validationFieldRequired') {
toggleRequiredLabelClass();
Expand Down
Loading

0 comments on commit bac6e0b

Please sign in to comment.