feat(FormGroup): add eager validation (#992)

This commit is contained in:
Conner Blanton
2023-11-21 16:24:15 -06:00
committed by GitHub
parent 9df9b9a2df
commit d39e2de935
6 changed files with 38 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ type InputProps = {
color?: string
name?: string
isFieldset?: boolean
eagerValidation?: boolean
}
export const useFormGroup = (inputProps?: InputProps, config?: any) => {
@@ -49,7 +50,7 @@ export const useFormGroup = (inputProps?: InputProps, config?: any) => {
}
const emitFormInput = useDebounceFn(() => {
if (blurred.value) {
if (blurred.value || formGroup?.eagerValidation.value) {
emitFormEvent('input', formGroup?.name.value)
}
}, 300)