@sveltejs/kit 1.0.2 → 1.0.3
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.
- package/package.json +1 -1
- package/src/runtime/client/client.js +12 -5
package/package.json
CHANGED
|
@@ -1461,21 +1461,28 @@ export function create_client({ target, base }) {
|
|
|
1461
1461
|
if (method !== 'get') return;
|
|
1462
1462
|
|
|
1463
1463
|
const url = new URL(
|
|
1464
|
-
(
|
|
1464
|
+
(submitter?.hasAttribute('formaction') && submitter?.formAction) || form.action
|
|
1465
1465
|
);
|
|
1466
1466
|
|
|
1467
1467
|
if (is_external_url(url, base)) return;
|
|
1468
1468
|
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1471
|
-
);
|
|
1469
|
+
const event_form = /** @type {HTMLFormElement} */ (event.target);
|
|
1470
|
+
|
|
1471
|
+
const { noscroll, reload } = get_router_options(event_form);
|
|
1472
1472
|
if (reload) return;
|
|
1473
1473
|
|
|
1474
1474
|
event.preventDefault();
|
|
1475
1475
|
event.stopPropagation();
|
|
1476
1476
|
|
|
1477
|
+
const data = new FormData(event_form);
|
|
1478
|
+
|
|
1479
|
+
const submitter_name = submitter?.getAttribute('name');
|
|
1480
|
+
if (submitter_name) {
|
|
1481
|
+
data.append(submitter_name, submitter?.getAttribute('value') ?? '');
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1477
1484
|
// @ts-expect-error `URLSearchParams(fd)` is kosher, but typescript doesn't know that
|
|
1478
|
-
url.search = new URLSearchParams(
|
|
1485
|
+
url.search = new URLSearchParams(data).toString();
|
|
1479
1486
|
|
|
1480
1487
|
navigate({
|
|
1481
1488
|
url,
|