Skip to content

Commit

Permalink
fix(extension): 【dynamic-group】componentWillUnmount移除事件监听,解决折叠再展开的子元素…
Browse files Browse the repository at this point in the history
…移动错乱问题(didi#1912)
  • Loading branch information
wbccb committed Oct 17, 2024
1 parent d343fdd commit d54c861
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/extension/src/dynamic-group/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ export class DynamicGroupNode<
eventCenter.on('node:mousemove', this.onNodeMouseMove)
}

componentWillUnmount() {
super.componentWillUnmount()
const { eventCenter } = this.props.graphModel
eventCenter.off('node:rotate', this.onNodeRotate)
eventCenter.off('node:resize', this.onNodeResize)
eventCenter.off('node:mousemove', this.onNodeMouseMove)
}

/**
* 获取分组内的节点
* @param groupModel
Expand Down

0 comments on commit d54c861

Please sign in to comment.