@expressen/tallahassee
Advanced tools
Comparing version 14.2.0 to 14.3.0
@@ -10,7 +10,7 @@ "use strict"; | ||
this.ownerDocument.addEventListener("click", (e) => { | ||
if (this.form && !e.defaultPrevented) { | ||
if (this.form && !e.defaultPrevented && e.target.type === "submit") { | ||
const parentForm = this.closest("form"); | ||
if (!parentForm || parentForm !== this.form) { | ||
const form = this.ownerDocument.getElementById(this.form.id); | ||
form.submit(); | ||
form._submit(e); | ||
} | ||
@@ -17,0 +17,0 @@ } |
@@ -56,6 +56,3 @@ "use strict"; | ||
if (target.type === "submit") { | ||
if (!this.noValidate && !this.reportValidity()) return; | ||
const submitEvent = new SubmitEvent("submit"); | ||
submitEvent[symbols.submitter] = event.target; | ||
super.dispatchEvent(submitEvent); | ||
this._submit(event); | ||
} else if (target.type === "reset") { | ||
@@ -65,2 +62,10 @@ this.reset(); | ||
} | ||
_submit(sourceEvent) { | ||
if (!this.noValidate && !this.reportValidity()) return; | ||
const submitEvent = new SubmitEvent("submit"); | ||
submitEvent[symbols.submitter] = sourceEvent.target; | ||
super.dispatchEvent(submitEvent); | ||
} | ||
submit() { | ||
@@ -67,0 +72,0 @@ this.dispatchEvent(new Event("_form_submit", { bubbles: true })); |
{ | ||
"name": "@expressen/tallahassee", | ||
"version": "14.2.0", | ||
"version": "14.3.0", | ||
"description": "Lightweight client testing framework", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3671
119655
428
61