feat(Form): add validate-on error-input

Adds `error-input` option to the validate on prop to validate on input
only when the field has an error.

Resolves #2599
This commit is contained in:
Romain Hamel
2025-06-14 18:09:02 +02:00
parent 59c26ec123
commit d8f29e019d
16 changed files with 47 additions and 29 deletions

View File

@@ -4,7 +4,7 @@ import Textarea, { type TextareaProps, type TextareaSlots } from '../../src/runt
import ComponentRender from '../component-render'
import theme from '#build/ui/textarea'
import { renderForm } from '../utils/form'
import type { FormInputEvents } from '~/src/module'
import type { FormValidateOn } from '~/src/module'
describe('Textarea', () => {
const sizes = Object.keys(theme.variants.size) as any
@@ -107,7 +107,7 @@ describe('Textarea', () => {
})
describe('form integration', async () => {
async function createForm(validateOn?: FormInputEvents[], eagerValidation?: boolean) {
async function createForm(validateOn?: FormValidateOn[], eagerValidation?: boolean) {
const wrapper = await renderForm({
props: {
validateOn,