Skip to content

[Bug Report] batch 批量赋值时字段x-visible没有正确联动 #3666

@Grapedge

Description

@Grapedge
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

可见性(x-visible)联动条件:

  • fieldB: 当 fieldA 的值为 "fieldA" 时显示
  • fieldC: 当 fieldB 的值为 "fieldB" 时显示

使用 batch 赋值字段:

batch(() => {
  Object.assign(field.value, {
    fieldB: 'fieldB',
    fieldC: 'fieldC',
    fieldA: 'fieldA',
  })
})

What is expected?

期望 fieldA, fieldB, fieldC 全部展示出来

What is actually happening?

只展示了 fieldA, fieldB。

Package

@formily/reactive@2.2.16


  1. 如果不使用 batch,展示是正确的。
  2. 如果将 batch 写法里的对象 key 调整为 fieldA,fieldB,fieldC 的顺序,也是正确的(但明显不应该依赖 key 的顺序):
batch(() => {
  Object.assign(field.value, {
    fieldA: 'fieldA',
    fieldB: 'fieldB',
    fieldC: 'fieldC',
  })
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions