Skip to content

Commit

Permalink
Merge pull request #9 from skttl/event-null-error-when-validateForm
Browse files Browse the repository at this point in the history
Fixes bug when using v.validateForm()
  • Loading branch information
haacked authored Nov 18, 2021
2 parents 2bfcde7 + 657bc5b commit 70857ea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,12 @@ export class ValidationService {
form.dispatchEvent(validationEvent);
return;
}
e.preventDefault();
e.stopImmediatePropagation();

if (e) {
e.preventDefault();
e.stopImmediatePropagation();
}

const validationEvent = new CustomEvent('validation',
{
detail: { valid: false }
Expand Down

0 comments on commit 70857ea

Please sign in to comment.