Skip to content

Commit

Permalink
fix(location modal): validate only on $invalid (#438)
Browse files Browse the repository at this point in the history
This commit ensures that the location modal does not flash red when
submitting.  This bug was introduced by watching `$error` instead of
`$invalid` when displaying input validation and is corrected here.
  • Loading branch information
jniles authored and sfount committed May 26, 2016
1 parent 8b0db80 commit f0a94eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/src/partials/templates/modals/location.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h4>{{ "FORM.LABELS.CONFIRMATION" | translate }}</h4>
</div>

<div class="form-group"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.country.$error }"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.country.$invalid }"
>
<label class="control-label">
{{ "FORM.LABELS.COUNTRY" | translate }}
Expand All @@ -47,7 +47,7 @@ <h4>{{ "FORM.LABELS.CONFIRMATION" | translate }}</h4>
</div>

<div class="form-group"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.province.$error }"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.province.$invalid }"
ng-if="LocationModalCtrl.view.index > 1"
>
<label class="control-label">
Expand Down Expand Up @@ -75,7 +75,7 @@ <h4>{{ "FORM.LABELS.CONFIRMATION" | translate }}</h4>

<div class="form-group"
ng-if="LocationModalCtrl.view.index > 2"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.sector.$error }"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.sector.$invalid }"
>
<label class="control-label">
{{ "FORM.LABELS.SECTOR" | translate }}
Expand All @@ -100,7 +100,7 @@ <h4>{{ "FORM.LABELS.CONFIRMATION" | translate }}</h4>

<div class="form-group"
ng-if="LocationModalCtrl.view.index > 3"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.village.$error }"
ng-class="{ 'has-error' : LocationModalForm.$submitted && LocationModalForm.village.$invalid }"
>
<label class="control-label">
{{ "FORM.LABELS.VILLAGE" | translate }}
Expand Down

0 comments on commit f0a94eb

Please sign in to comment.