From 50b5f21133bffeccfa8a3bb017ff4f0019539c00 Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Tue, 1 Aug 2023 20:35:32 +1000 Subject: [PATCH 1/2] Disable validate on change after a reset --- .changeset/fast-dogs-wait.md | 5 +++++ lib/useForm.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/fast-dogs-wait.md diff --git a/.changeset/fast-dogs-wait.md b/.changeset/fast-dogs-wait.md new file mode 100644 index 0000000..fb4689d --- /dev/null +++ b/.changeset/fast-dogs-wait.md @@ -0,0 +1,5 @@ +--- +"@stevent-team/react-zoom-form": patch +--- + +Disable validation on change after a reset until the next submit event diff --git a/lib/useForm.ts b/lib/useForm.ts index 49989ee..257ef85 100644 --- a/lib/useForm.ts +++ b/lib/useForm.ts @@ -57,6 +57,7 @@ export const useForm = ({ const isDirty = useMemo(() => !deepEqual(formValue, internalInitialValues), [formValue, internalInitialValues]) const reset = useCallback['reset']>((values = initialValues) => { + setValidateOnChange(false) setInternalInitialValues(values) setFormValue(values) }, [initialValues]) From 4ac5aa934079111363df50bdad27f3de39c3135a Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Tue, 1 Aug 2023 20:35:41 +1000 Subject: [PATCH 2/2] Reduce the size of the car slightly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0062e68..07a96e5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# React Zoom Form car +# React Zoom Form car [![npm version](https://img.shields.io/npm/v/@stevent-team/react-zoom-form)](https://www.npmjs.com/package/@stevent-team/react-zoom-form) [![minzip size](https://img.shields.io/bundlephobia/minzip/@stevent-team/react-zoom-form)](https://bundlephobia.com/package/@stevent-team/react-zoom-form)