Skip to content

Commit

Permalink
Fix isValid() for empty forms
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlbyk committed Mar 27, 2024
1 parent 38ef69b commit 8a249a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ export class ValidationService {
}
let formUID = this.getElementUID(form);
let formInputUIDs = this.formInputs[formUID];
let invalidFormInputUIDs = formInputUIDs.filter(uid => this.summary[uid]);
return invalidFormInputUIDs.length == 0;
let formIsInvalid = formInputUIDs?.some(uid => this.summary[uid]) === true;
return !formIsInvalid;
}

/**
Expand Down

0 comments on commit 8a249a3

Please sign in to comment.