1
0
Fork 0
mirror of synced 2024-07-09 08:16:34 +12:00

Reset field value to default value if default value changes

This commit is contained in:
Andrew Kingston 2021-12-09 14:51:19 +00:00
parent eedd1f0cf6
commit 707ed7419d

View file

@ -102,8 +102,15 @@
const existingField = getField(field)
if (existingField) {
const { fieldState } = get(existingField)
initialValue = fieldState.value ?? initialValue
fieldId = fieldState.fieldId
// Use new default value if default value changed,
// otherwise use the current value if possible
if (defaultValue !== fieldState.defaultValue) {
initialValue = defaultValue
} else {
initialValue = fieldState.value ?? initialValue
}
}
// Auto columns are always disabled