Skip to content

Commit

Permalink
fix(core): fix unmounteRemoveValue property is not work #827 (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang authored May 18, 2020
1 parent 2cadf73 commit f53d02a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function createForm(options: IFormCreatorOptions = {}) {
if (
unmountedChanged &&
(published.display !== false || published.visible === false) &&
published.unmountRemoveValue
published.unmountRemoveValue === true
) {
if (published.unmounted) {
if (isValid(published.value)) {
Expand Down Expand Up @@ -525,7 +525,6 @@ export function createForm(options: IFormCreatorOptions = {}) {
dataPath,
computeState,
dataType,
unmountRemoveValue,
useDirty: isValid(useDirty) ? useDirty : options.useDirty
})
field.subscription = {
Expand All @@ -548,6 +547,10 @@ export function createForm(options: IFormCreatorOptions = {}) {
state.initialValue = formInitialValue
}

if (isValid(unmountRemoveValue)) {
state.unmountRemoveValue = unmountRemoveValue
}

if (isValid(value)) {
// value > formValue > initialValue
state.value = value
Expand Down

0 comments on commit f53d02a

Please sign in to comment.