Skip to content

Commit

Permalink
Added ability for users who don't want to always disable the submit b…
Browse files Browse the repository at this point in the history
…utton, to display all the errors in the form upon the user interacting with the submit button. (#459)
  • Loading branch information
shoxter authored and miguelcobain committed Aug 2, 2016
1 parent 83eac1e commit 69a6376
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions addon/components/paper-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ export default Component.extend(ParentMixin, {
}
},
onSubmit() {
this.sendAction('onSubmit');
this.get('childComponents').setEach('isTouched', false);
if (this.get('isInvalid')) {
this.get('childComponents').setEach('isTouched', true);
} else {
this.sendAction('onSubmit');
this.get('childComponents').setEach('isTouched', false);
}
}
}
});

0 comments on commit 69a6376

Please sign in to comment.