From 459a0410ab729fde60865e84632b36903465f57e Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 13 May 2025 17:40:11 +0200 Subject: [PATCH] fix(FormField): use `div` for `error` and `help` slots --- src/runtime/components/FormField.vue | 8 ++++---- test/components/__snapshots__/Form-vue.spec.ts.snap | 12 ++++++------ test/components/__snapshots__/Form.spec.ts.snap | 12 ++++++------ .../__snapshots__/FormField-vue.spec.ts.snap | 8 ++++---- test/components/__snapshots__/FormField.spec.ts.snap | 8 ++++---- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/runtime/components/FormField.vue b/src/runtime/components/FormField.vue index 2c12fbbc..f8d8a3ff 100644 --- a/src/runtime/components/FormField.vue +++ b/src/runtime/components/FormField.vue @@ -115,16 +115,16 @@ provide(formFieldInjectionKey, computed(() => ({
-

+

{{ error }} -

-

+

+
{{ help }} -

+
diff --git a/test/components/__snapshots__/Form-vue.spec.ts.snap b/test/components/__snapshots__/Form-vue.spec.ts.snap index e1339eef..6701093d 100644 --- a/test/components/__snapshots__/Form-vue.spec.ts.snap +++ b/test/components/__snapshots__/Form-vue.spec.ts.snap @@ -25,7 +25,7 @@ exports[`Form > custom validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -87,7 +87,7 @@ exports[`Form > joi validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -153,7 +153,7 @@ exports[`Form > superstruct validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -215,7 +215,7 @@ exports[`Form > valibot validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -277,7 +277,7 @@ exports[`Form > yup validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -339,7 +339,7 @@ exports[`Form > zod validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" diff --git a/test/components/__snapshots__/Form.spec.ts.snap b/test/components/__snapshots__/Form.spec.ts.snap index 81f87c37..0a0e2677 100644 --- a/test/components/__snapshots__/Form.spec.ts.snap +++ b/test/components/__snapshots__/Form.spec.ts.snap @@ -25,7 +25,7 @@ exports[`Form > custom validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -87,7 +87,7 @@ exports[`Form > joi validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -153,7 +153,7 @@ exports[`Form > superstruct validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -215,7 +215,7 @@ exports[`Form > valibot validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -277,7 +277,7 @@ exports[`Form > yup validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" @@ -339,7 +339,7 @@ exports[`Form > zod validation works > with error 1`] = ` -

Must be at least 8 characters

+
Must be at least 8 characters
" diff --git a/test/components/__snapshots__/FormField-vue.spec.ts.snap b/test/components/__snapshots__/FormField-vue.spec.ts.snap index 4f4469c0..bee8f680 100644 --- a/test/components/__snapshots__/FormField-vue.spec.ts.snap +++ b/test/components/__snapshots__/FormField-vue.spec.ts.snap @@ -55,7 +55,7 @@ exports[`FormField > renders with error correctly 1`] = `
-

Username is already taken

+
Username is already taken
" `; @@ -67,7 +67,7 @@ exports[`FormField > renders with error slot correctly 1`] = `
-

Error slot

+
Error slot
" `; @@ -79,7 +79,7 @@ exports[`FormField > renders with help correctly 1`] = `
-

Username must be unique

+
Username must be unique
" `; @@ -91,7 +91,7 @@ exports[`FormField > renders with help slot correctly 1`] = `
-

Help slot

+
Help slot
" `; diff --git a/test/components/__snapshots__/FormField.spec.ts.snap b/test/components/__snapshots__/FormField.spec.ts.snap index 4f4469c0..bee8f680 100644 --- a/test/components/__snapshots__/FormField.spec.ts.snap +++ b/test/components/__snapshots__/FormField.spec.ts.snap @@ -55,7 +55,7 @@ exports[`FormField > renders with error correctly 1`] = `
-

Username is already taken

+
Username is already taken
" `; @@ -67,7 +67,7 @@ exports[`FormField > renders with error slot correctly 1`] = `
-

Error slot

+
Error slot
" `; @@ -79,7 +79,7 @@ exports[`FormField > renders with help correctly 1`] = `
-

Username must be unique

+
Username must be unique
" `; @@ -91,7 +91,7 @@ exports[`FormField > renders with help slot correctly 1`] = `
-

Help slot

+
Help slot
" `;