File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export const useForm = <T extends Record<keyof T, any> = {}>(options?: {
51
51
[ key ] : value ,
52
52
} )
53
53
const initialValues : Partial < T > = options ?. initialValues ?? { }
54
- setDirtyFields ( { ...dirtyFields , [ key ] : initialValues [ key ] === data [ key ] } )
54
+ setDirtyFields ( { ...dirtyFields , [ key ] : initialValues [ key ] !== value } )
55
55
56
56
const validationMode = options ?. validationMode ?? 'onChange'
57
57
if ( validationMode === 'onChange' || enableValidationOnChange [ key ] || errors [ key ] ) {
@@ -90,7 +90,7 @@ export const useForm = <T extends Record<keyof T, any> = {}>(options?: {
90
90
*/
91
91
const onFocus = ( key : keyof T ) => ( ) => {
92
92
setTouchedFields ( {
93
- ...data ,
93
+ ...touchedFields ,
94
94
[ key ] : true ,
95
95
} )
96
96
}
You can’t perform that action at this time.
0 commit comments