remix-validated-form 4.6.7 → 4.6.9

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remix-validated-form",
3
- "version": "4.6.7",
3
+ "version": "4.6.9",
4
4
  "description": "Form component and utils for easy form validation in remix",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",
@@ -57,6 +57,6 @@
57
57
  "lodash.get": "^4.4.2",
58
58
  "remeda": "^1.2.0",
59
59
  "tiny-invariant": "^1.2.0",
60
- "zustand": "^4.0.0-rc.1"
60
+ "zustand": "^4.3.0"
61
61
  }
62
62
  }
@@ -320,6 +320,7 @@ export function ValidatedForm<DataType>({
320
320
  ) => {
321
321
  startSubmit();
322
322
  const submitter = nativeEvent.submitter as HTMLFormSubmitter | null;
323
+ const formMethod = (submitter?.formMethod as FormMethod) || method;
323
324
  const formDataToValidate = getDataFromForm(e.currentTarget);
324
325
  if (submitter?.name) {
325
326
  formDataToValidate.append(submitter.name, submitter.value);
@@ -350,11 +351,12 @@ 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 || e.currentTarget);
354
+ if (fetcher)
355
+ fetcher.submit(submitter || e.currentTarget, { method: formMethod });
354
356
  else
355
357
  submit(submitter || target, {
356
358
  replace,
357
- method: (submitter?.formMethod as FormMethod) || method,
359
+ method: formMethod,
358
360
  });
359
361
  }
360
362
  };
@@ -1,7 +1,7 @@
1
1
  import { WritableDraft } from "immer/dist/internal";
2
2
  import { getPath, setPath } from "set-get";
3
3
  import invariant from "tiny-invariant";
4
- import create, { GetState } from "zustand";
4
+ import { create, GetState } from "zustand";
5
5
  import { immer } from "zustand/middleware/immer";
6
6
  import {
7
7
  FieldErrors,