From baba160ae886f3c350a56d1f108092faebfd15d9 Mon Sep 17 00:00:00 2001 From: Alex Sheiko <61295121+Kelamir@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:24:37 +0200 Subject: [PATCH] Update docs to make first example work as expected Fixes https://github.com/chainlist/svelte-forms/issues/95 It's expected that a form would behave as if it has checkOnInit on: empty form is invalid - false, once you add some input, it's true. One can of course read the documentation in detail to figure out what's wrong, but it might be useful for the first example to be self-sufficient. The change was proposed by grischaerbe in the issue, and it is already explained in documentation. Thoughts on adding this to documentation? --- src/docs/2_Examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/2_Examples.md b/src/docs/2_Examples.md index 1406a9d..48066f5 100644 --- a/src/docs/2_Examples.md +++ b/src/docs/2_Examples.md @@ -11,7 +11,7 @@ filename: 2_Examples.md import { form, field } from 'svelte-forms'; import { required } from 'svelte-forms/validators'; - const name = field('name', '', [required()]); + const name = field('name', '', [required()], { checkOnInit: true }); const myForm = form(name);