Skip to content

Commit

Permalink
docs(components): update form docs
Browse files Browse the repository at this point in the history
iinclude default value for resetOn prop
  • Loading branch information
joshuagraber committed Jun 19, 2024
1 parent 24a56da commit fde7d51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/Form/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'` |



Expand Down
1 change: 1 addition & 0 deletions src/demo/pages/SignupFormDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function handlePasswordValidation(formValues: Record<string, string>) {
*/
function onSubmit(formValues: Record<string, string>) {
if (!handlePasswordValidation(formValues)) {
reset.value = false;
return;
} else {
reset.value = true;
Expand Down

0 comments on commit fde7d51

Please sign in to comment.