Skip to content

Commit

Permalink
fix: corrects pathing to obtaining children isInvalid/isTouched.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Dec 18, 2024
1 parent 69b553a commit ae543ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addon/components/paper-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ export default class PaperForm extends Component {
}

get isInvalid() {
return this.children.isAny('isInvalid');
return this.children.isAny('validation.isInvalid');
}

get isTouched() {
return this.children.isAny('isTouched');
return this.children.isAny('validation.isTouched');
}

get isInvalidAndTouched() {
Expand Down Expand Up @@ -112,15 +112,15 @@ export default class PaperForm extends Component {

@action localOnSubmit() {
if (this.isInvalid) {
this.children.setEach('isTouched', true);
this.children.setEach('validation.isTouched', true);
if (this.args.onInvalid) {
this.args.onInvalid();
}
} else {
if (this.args.onSubmit) {
this.args.onSubmit();
}
this.children.setEach('isTouched', false);
this.children.setEach('validation.isTouched', false);
}
}
}

0 comments on commit ae543ae

Please sign in to comment.