File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/vee-validate/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' vee-validate ' : patch
3+ ---
4+
5+ fix: exclude undefined and null from initial values closes #4139
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export interface FormOptions<
8383 | TypedSchema < TValues , TOutput >
8484> {
8585 validationSchema ?: MaybeRef < TSchema extends TypedSchema ? TypedSchema < TValues , TOutput > : any > ;
86- initialValues ?: MaybeRef < PartialDeep < TValues > > ;
86+ initialValues ?: MaybeRef < PartialDeep < TValues > | undefined | null > ;
8787 initialErrors ?: FlattenAndSetPathsType < TValues , string | undefined > ;
8888 initialTouched ?: FlattenAndSetPathsType < TValues , boolean > ;
8989 validateOnMount ?: boolean ;
@@ -1066,7 +1066,9 @@ function useFormInitialValues<TValues extends GenericObject>(
10661066 watch (
10671067 providedValues ,
10681068 value => {
1069- setInitialValues ( value , true ) ;
1069+ if ( value ) {
1070+ setInitialValues ( value , true ) ;
1071+ }
10701072 } ,
10711073 {
10721074 deep : true ,
You can’t perform that action at this time.
0 commit comments