Merge pull request #10887 from Budibase/fix/on-change-actions

Fix field on change actions not properly checking for unchanged values
This commit is contained in:
Andrew Kingston 2023-06-22 11:49:56 +01:00 committed by GitHub
commit ca18ab02bd
1 changed files with 5 additions and 4 deletions

View File

@ -283,7 +283,7 @@
// Skip if the value is the same
if (!skipCheck && fieldState.value === value) {
return true
return false
}
// Update field state
@ -295,7 +295,7 @@
return state
})
return !error
return true
}
// Clears the value of a certain field back to the default value
@ -376,8 +376,9 @@
deregister,
validate: () => {
// Validate the field by force setting the same value again
const { fieldState } = get(getField(field))
return setValue(fieldState.value, true)
const fieldInfo = getField(field)
setValue(get(fieldInfo).fieldState.value, true)
return !get(fieldInfo).fieldState.error
},
}
}