remix-validated-form 4.6.8 → 4.6.10
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +18 -17
- package/.turbo/turbo-typecheck.log +0 -13
- package/dist/index.cjs.js +4 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +4 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/ValidatedForm.tsx +4 -3
package/package.json
CHANGED
package/src/ValidatedForm.tsx
CHANGED
@@ -320,7 +320,8 @@ export function ValidatedForm<DataType>({
|
|
320
320
|
) => {
|
321
321
|
startSubmit();
|
322
322
|
const submitter = nativeEvent.submitter as HTMLFormSubmitter | null;
|
323
|
-
const
|
323
|
+
const formMethod = (submitter?.formMethod as FormMethod) || method;
|
324
|
+
const formDataToValidate = getDataFromForm(target);
|
324
325
|
if (submitter?.name) {
|
325
326
|
formDataToValidate.append(submitter.name, submitter.value);
|
326
327
|
}
|
@@ -350,11 +351,11 @@ export function ValidatedForm<DataType>({
|
|
350
351
|
// but we already have the form in `formRef.current` so we can just use that.
|
351
352
|
// If we use `event.currentTarget` here, it will break because `currentTarget`
|
352
353
|
// will have changed since the start of the submission.
|
353
|
-
if (fetcher) fetcher.submit(submitter ||
|
354
|
+
if (fetcher) fetcher.submit(submitter || target, { method: formMethod });
|
354
355
|
else
|
355
356
|
submit(submitter || target, {
|
356
357
|
replace,
|
357
|
-
method:
|
358
|
+
method: formMethod,
|
358
359
|
});
|
359
360
|
}
|
360
361
|
};
|