antvis/G6




The issue has been closed
updateChildren、updateChild等,执行后会清空所有节点状态,这会导致选中态等状态需要再更新后手动赋值 #4643
cicada-ah posted onGitHub
Describe the bug
请教下原因:updateChildren、updateChild等,执行后会清空所有节点状态,这会导致父节点选中态等状态需要再更新后手动赋值,我想这是不符合预期的吧,例如选中节点,在属性面板中updateChildren,此时预期是状态未被清空
Your Example Website or App
无
Steps to Reproduce the Bug or Issue
- 选中节点状态
- 调用updateChildren
- updateChaildren调用updateData方法,会遍历所有节点和边,并清空状态
Expected behavior
上述操作不必清空状态,至少updateChildren和changeData可以添加option去交给开发者取舍,否则要重写继承,成本有些大
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
No response