Skip to content

Commit

Permalink
Fixed issue nelsonomuto#60
Browse files Browse the repository at this point in the history
  • Loading branch information
Ionel Nicolenco authored and Ionel Nicolenco committed Sep 8, 2016
1 parent 4d85773 commit e881d1d
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 e881d1d

Please sign in to comment.