Skip to content

Commit

Permalink
fix: stencil addGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
sunven committed Nov 30, 2023
1 parent fd5b061 commit e9747c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/x6-example-features/src/pages/stencil/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export default class Example extends React.Component {

stencil.load([r, c, c2, r2.clone()], 'group1')
stencil.load([c2.clone(), r2, r3, c3], 'group2')
stencil.addGroup({ name: 'group3' })
stencil.load([c2.clone()], 'group3')
}

refContainer = (container: HTMLDivElement) => {
Expand Down
6 changes: 5 additions & 1 deletion packages/x6-plugin-stencil/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ export class Stencil extends View implements Graph.Plugin {
} else {
this.options.groups = groups
}
groups.forEach((group) => this.initGroup(group))
groups.forEach((group) => {
this.initGroup(group)
const graph = this.graphs[group.name]
graph.on('cell:mousedown', this.onDragStart, this)
})
}

removeGroup(groupName: string | string[]) {
Expand Down

0 comments on commit e9747c6

Please sign in to comment.