File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @programmer_network/use-ajv-form" ,
3
- "version" : " 1.0.23 " ,
3
+ "version" : " 1.0.24 " ,
4
4
"description" : " Custom React Hook that integrates with Ajv JSON Schema Validator" ,
5
5
"main" : " dist/use-ajv-form.es.js" ,
6
6
"author" : " Aleksandar Grbic" ,
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ const useAJVForm = <T extends Record<string, any>>(
35
35
editId : number ;
36
36
} | null > ( null ) ;
37
37
const [ editCounter , setEditCounter ] = useState ( 0 ) ;
38
- const debouncedField = useDebounce ( currentField , options ?. debounceTime || 500 ) ;
38
+ const debouncedField = useDebounce ( currentField , options ?. debounceTime || 1000 ) ;
39
39
const logger = useMemo (
40
40
( ) => new Logger ( options ?. debug || false ) ,
41
41
[ options ?. debug ] ,
@@ -222,12 +222,15 @@ const useAJVForm = <T extends Record<string, any>>(
222
222
} ;
223
223
224
224
useEffect ( ( ) => {
225
- if ( options ?. shouldDebounceAndValidate === false || ! debouncedField ) {
225
+ if (
226
+ options ?. shouldDebounceAndValidate === false ||
227
+ ! debouncedField ||
228
+ ! isDirty
229
+ ) {
226
230
return ;
227
231
}
228
-
229
232
validateField ( debouncedField . name ) ;
230
- } , [ debouncedField ] ) ;
233
+ } , [ debouncedField , isDirty ] ) ;
231
234
232
235
useEffect ( ( ) => {
233
236
if ( ! options ?. errors ?. length ) {
You can’t perform that action at this time.
0 commit comments