Skip to content

Commit

Permalink
docs: add callout about eager-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
connerblanton committed Nov 18, 2023
1 parent dee496b commit b793150
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/content/3.forms/10.form.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ async function onSubmit (event: FormSubmitEvent<any>) {

The Form component automatically triggers validation upon `submit`, `input`, `blur` or `change` events. This ensures that any errors are displayed as soon as the user interacts with the form elements. You can control when validation happens this using the `validate-on` prop.

::callout{icon="i-heroicons-light-bulb"}
Note that the `input` event is not triggered on the [`Input`](/forms/input) and [`Textarea`](/forms/textarea) components until after the initial `blur` event. This is to prevent the form from being validated as the user is typing. You can override this behavior by setting the `eagerValidation` prop on these components to `true`.
::

::component-example
---
component: 'form-example-elements'
Expand Down

0 comments on commit b793150

Please sign in to comment.