From fde7d517982d042d331e91e5d896af45fc8aef51 Mon Sep 17 00:00:00 2001 From: Joshua Graber Date: Tue, 18 Jun 2024 21:01:50 -0400 Subject: [PATCH] docs(components): update form docs iinclude default value for resetOn prop --- src/components/Form/README.md | 14 +++++++------- src/demo/pages/SignupFormDemo.vue | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/Form/README.md b/src/components/Form/README.md index ee282bf..4eab8e4 100644 --- a/src/components/Form/README.md +++ b/src/components/Form/README.md @@ -4,13 +4,13 @@ The `Form` component is powerful. All you need to do is pass a few props, and th ## Props -| name | required? | types | description | default | -| --------- | --------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| `error` | no | `string` \| `undefined` \| `null` | Error state | `undefined` | -| `id` | yes | `string` | Form id | none | -| `name` | yes | `string` | Form name | none | -| `schema` | yes | `PdapFormSchema` (array of `PdapFormInputProps` objects) | Array of schema entries for inputs | none | -| `resetOn` | no | `'submit'` \| `boolean` | When to reset form - if `'submit'`, it happens during submission. If `boolean`, it happens when the value of the prop changes to `true` | none | +| name | required? | types | description | default | +| --------- | --------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------- | +| `error` | no | `string` \| `undefined` \| `null` | Error state | `undefined` | +| `id` | yes | `string` | Form id | none | +| `name` | yes | `string` | Form name | none | +| `schema` | yes | `PdapFormSchema` (array of `PdapFormInputProps` objects) | Array of schema entries for inputs | none | +| `resetOn` | no | `'submit'` \| `boolean` | When to reset form - if `'submit'`, it happens during submission. If `boolean`, it happens on any change of the prop to `true` | `'submit'` | diff --git a/src/demo/pages/SignupFormDemo.vue b/src/demo/pages/SignupFormDemo.vue index a6d98ed..72fc53e 100644 --- a/src/demo/pages/SignupFormDemo.vue +++ b/src/demo/pages/SignupFormDemo.vue @@ -101,6 +101,7 @@ function handlePasswordValidation(formValues: Record) { */ function onSubmit(formValues: Record) { if (!handlePasswordValidation(formValues)) { + reset.value = false; return; } else { reset.value = true;