Skip to content

Commit

Permalink
prevent default behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasCARPi committed Dec 9, 2021
1 parent c5b92e1 commit 382f033
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export class Malle {
* Process the submit event: call user function and replace the input div with original element
*/
submit(event): boolean {
// don't let the browser do anything
event.preventDefault();

// trigger browser validity check
// and abort if it's not valid
if (!this.form.reportValidity()) {
Expand Down

0 comments on commit 382f033

Please sign in to comment.