Skip to content

Commit

Permalink
also trigger onValidityChange when isTouched changes
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Mar 6, 2017
1 parent 4b168ec commit 78b6efb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion addon/mixins/validation-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ export default Mixin.create({
notifyValidityChange() {
let isValid = this.get('isValid');
let lastIsValid = this.get('lastIsValid');
if (lastIsValid !== isValid) {
let isTouched = this.get('isTouched');
let lastIsTouched = this.get('lastIsTouched');
if (lastIsValid !== isValid || lastIsTouched !== isTouched) {
this.sendAction('onValidityChange', isValid);
this.set('lastIsValid', isValid);
this.set('lastIsTouched', isTouched);
}
},
customValidations: [],
Expand Down

0 comments on commit 78b6efb

Please sign in to comment.