@@ -149,6 +149,13 @@ export function useForm<
149149 return ;
150150 }
151151
152+ // Move the error from the extras path if exists
153+ if ( typeof field === 'string' ) {
154+ if ( extraErrorsBag . value [ normalizeFormPath ( field ) as Path < TValues > ] ) {
155+ delete extraErrorsBag . value [ normalizeFormPath ( field ) as Path < TValues > ] ;
156+ }
157+ }
158+
152159 state . errors = normalizeErrorItem ( message ) ;
153160 state . valid = ! state . errors . length ;
154161 }
@@ -291,10 +298,9 @@ export function useForm<
291298
292299 pathStates . value . push ( state ) ;
293300
294- // if it has errors before, validate it.
295301 if ( errors . value [ pathValue ] && ! initialErrors [ pathValue ] ) {
296302 nextTick ( ( ) => {
297- validateField ( pathValue ) ;
303+ validateField ( pathValue , { mode : 'silent' } ) ;
298304 } ) ;
299305 }
300306
@@ -500,6 +506,10 @@ export function useForm<
500506 return ;
501507 }
502508
509+ nextTick ( ( ) => {
510+ validateField ( path , { mode : 'silent' } ) ;
511+ } ) ;
512+
503513 if ( pathState . multiple && pathState . fieldsCount ) {
504514 pathState . fieldsCount -- ;
505515 }
@@ -738,20 +748,20 @@ export function useForm<
738748 } ;
739749 }
740750
741- async function validateField ( path : Path < TValues > ) : Promise < ValidationResult > {
751+ async function validateField ( path : Path < TValues > , opts ?: Partial < ValidationOptions > ) : Promise < ValidationResult > {
742752 const state = findPathState ( path ) ;
743753 if ( state ) {
744754 state . validated = true ;
745755 }
746756
747757 if ( schema ) {
748- const { results } : FormValidationResult < TValues , TOutput > = await validateSchema ( 'validated-only' ) ;
758+ const { results } : FormValidationResult < TValues , TOutput > = await validateSchema ( opts ?. mode || 'validated-only' ) ;
749759
750760 return results [ path ] || { errors : [ ] , valid : true } ;
751761 }
752762
753763 if ( state ?. validate ) {
754- return state . validate ( ) ;
764+ return state . validate ( opts ) ;
755765 }
756766
757767 if ( ! state ) {
0 commit comments