@primate/core 0.9.17 → 0.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -53,7 +53,10 @@ export default (frontend, u) => {
|
|
|
53
53
|
const { enctype } = target;
|
|
54
54
|
const action = target.getAttribute("action") ?? location.href;
|
|
55
55
|
const url = new URL(action, location.href);
|
|
56
|
-
const
|
|
56
|
+
const submitter = event.submitter;
|
|
57
|
+
const data = submitter === null
|
|
58
|
+
? new FormData(target)
|
|
59
|
+
: new FormData(target, submitter);
|
|
57
60
|
const form = enctype === http.MIME.MULTIPART_FORM_DATA
|
|
58
61
|
? data
|
|
59
62
|
: new URLSearchParams(data);
|
|
@@ -122,7 +122,10 @@ function createForm(init) {
|
|
|
122
122
|
const url = init.url
|
|
123
123
|
?? form_element.getAttribute("action")
|
|
124
124
|
?? globalThis.location.href;
|
|
125
|
-
const
|
|
125
|
+
const submitter = event?.submitter;
|
|
126
|
+
const form_data = submitter === null || submitter === undefined
|
|
127
|
+
? new FormData(form_element)
|
|
128
|
+
: new FormData(form_element, submitter);
|
|
126
129
|
setSubmitting(true);
|
|
127
130
|
try {
|
|
128
131
|
const response = await (is.defined(init.action)
|