Do not update form field value when default value changes to prevent endless loops
This commit is contained in:
parent
790da9bbb5
commit
c6cffa15ee
|
@ -157,13 +157,9 @@
|
||||||
const { fieldState } = get(existingField)
|
const { fieldState } = get(existingField)
|
||||||
fieldId = fieldState.fieldId
|
fieldId = fieldState.fieldId
|
||||||
|
|
||||||
// Use new default value if default value changed,
|
// Determine the initial value for this field, reusing the current
|
||||||
// otherwise use the current value if possible
|
// value if one exists
|
||||||
if (defaultValue !== fieldState.defaultValue) {
|
initialValue = fieldState.value ?? initialValue
|
||||||
initialValue = defaultValue
|
|
||||||
} else {
|
|
||||||
initialValue = fieldState.value ?? initialValue
|
|
||||||
}
|
|
||||||
|
|
||||||
// If this field has already been registered and we previously had an
|
// If this field has already been registered and we previously had an
|
||||||
// error set, then re-run the validator to see if we can unset it
|
// error set, then re-run the validator to see if we can unset it
|
||||||
|
|
Loading…
Reference in New Issue