Skip to content

Commit

Permalink
fix(core): fix intialValues sync (#875)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed May 28, 2020
1 parent c93b517 commit 9847f7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ export function createForm(options: IFormCreatorOptions = {}) {

if (initializedChanged) {
heart.publish(LifeCycleTypes.ON_FIELD_INIT, field)
const isEmptyValue = !isValid(published.value)
const isEmptyValue =
!isValid(published.value) || isEmpty(published.value)
const isEmptyInitialValue = !isValid(published.initialValue)
if (isEmptyValue || isEmptyInitialValue) {
field.setSourceState((state: IFieldState<FormilyCore.FieldProps>) => {
Expand Down

0 comments on commit 9847f7e

Please sign in to comment.