Skip to content

Commit

Permalink
fix(extension): 【dynamic-group】DynamicGroup 被复制后,内部的节点归属异常
Browse files Browse the repository at this point in the history
DynamicGroup 重写的 addElements 用原分组节点创建新的时,移除的 children 取值有问题,children 应该在 properties 中

Closes didi#1956
  • Loading branch information
wzw committed Nov 12, 2024
1 parent 6e11519 commit 53b8aa2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/extension/src/dynamic-group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,8 +667,11 @@ export class DynamicGroup {

forEach(selectedNodes, (node) => {
const originId = node.id
const { children, ...rest } = node
const model = lf.addNode(rest)
const { children, properties, ...rest } = node
const newProperties = { ...properties }
delete newProperties.children
const newNodeConfig = { ...rest, properties: newProperties }
const model = lf.addNode(newNodeConfig)

if (originId) nodeIdMap[originId] = model.id
elements.nodes.push(model) // 此时为 group 的 nodeModel
Expand Down

0 comments on commit 53b8aa2

Please sign in to comment.