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