remix-validated-form 4.0.1 → 4.0.2
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/browser/ValidatedForm.js
CHANGED
@@ -36,10 +36,12 @@ const useIsSubmitting = (fetcher) => {
|
|
36
36
|
const hasActiveSubmission = fetcher
|
37
37
|
? fetcher.state === "submitting"
|
38
38
|
: !!transition.submission;
|
39
|
-
const isSubmitting = hasActiveSubmission && isSubmitStarted;
|
40
39
|
const startSubmit = () => setSubmitStarted(true);
|
41
40
|
const endSubmit = () => setSubmitStarted(false);
|
42
|
-
|
41
|
+
useSubmitComplete(hasActiveSubmission, () => {
|
42
|
+
endSubmit();
|
43
|
+
});
|
44
|
+
return [isSubmitStarted, startSubmit, endSubmit];
|
43
45
|
};
|
44
46
|
const getDataFromForm = (el) => new FormData(el);
|
45
47
|
/**
|
package/build/ValidatedForm.js
CHANGED
@@ -61,10 +61,12 @@ const useIsSubmitting = (fetcher) => {
|
|
61
61
|
const hasActiveSubmission = fetcher
|
62
62
|
? fetcher.state === "submitting"
|
63
63
|
: !!transition.submission;
|
64
|
-
const isSubmitting = hasActiveSubmission && isSubmitStarted;
|
65
64
|
const startSubmit = () => setSubmitStarted(true);
|
66
65
|
const endSubmit = () => setSubmitStarted(false);
|
67
|
-
|
66
|
+
(0, submissionCallbacks_1.useSubmitComplete)(hasActiveSubmission, () => {
|
67
|
+
endSubmit();
|
68
|
+
});
|
69
|
+
return [isSubmitStarted, startSubmit, endSubmit];
|
68
70
|
};
|
69
71
|
const getDataFromForm = (el) => new FormData(el);
|
70
72
|
/**
|
package/package.json
CHANGED
package/src/ValidatedForm.tsx
CHANGED
@@ -114,12 +114,15 @@ const useIsSubmitting = (
|
|
114
114
|
const hasActiveSubmission = fetcher
|
115
115
|
? fetcher.state === "submitting"
|
116
116
|
: !!transition.submission;
|
117
|
-
const isSubmitting = hasActiveSubmission && isSubmitStarted;
|
118
117
|
|
119
118
|
const startSubmit = () => setSubmitStarted(true);
|
120
119
|
const endSubmit = () => setSubmitStarted(false);
|
121
120
|
|
122
|
-
|
121
|
+
useSubmitComplete(hasActiveSubmission, () => {
|
122
|
+
endSubmit();
|
123
|
+
});
|
124
|
+
|
125
|
+
return [isSubmitStarted, startSubmit, endSubmit];
|
123
126
|
};
|
124
127
|
|
125
128
|
const getDataFromForm = (el: HTMLFormElement) => new FormData(el);
|