diff --git a/addon/components/paper-form.js b/addon/components/paper-form.js index 33257dcb9..8a4deeb7c 100644 --- a/addon/components/paper-form.js +++ b/addon/components/paper-form.js @@ -30,6 +30,8 @@ export default Component.extend(ParentMixin, { return this.get('childComponents').isAny('isTouched'); }), + isInvalidAndTouched: computed.and('isInvalid', 'isTouched'), + submit() { this.send('onSubmit'); return false; @@ -38,7 +40,7 @@ export default Component.extend(ParentMixin, { actions: { onValidityChange() { if (this.get('lastIsValid') !== this.get('isValid')) { - this.sendAction('onValidityChange', this.get('isValid'), this.get('isTouched'), this.get('isInvalid') && this.get('isTouched')); + this.sendAction('onValidityChange', this.get('isValid'), this.get('isTouched'), this.get('isInvalidAndTouched')); this.set('lastIsValid', this.get('isValid')); } }, diff --git a/addon/templates/components/paper-form.hbs b/addon/templates/components/paper-form.hbs index 5633ee31e..726b0c954 100644 --- a/addon/templates/components/paper-form.hbs +++ b/addon/templates/components/paper-form.hbs @@ -1,6 +1,8 @@ {{yield (hash isValid=isValid isInvalid=isInvalid + isTouched=isTouched + isInvalidAndTouched=isInvalidAndTouched input=(component inputComponent parentComponent=this onValidityChange=(action "onValidityChange")