Skip to content

Commit

Permalink
fix(selection): 🐛 Fix nodes in multiple-selection being more than onc…
Browse files Browse the repository at this point in the history
…e due to incorrect event handler stopper
  • Loading branch information
oxiran authored Jun 10, 2022
1 parent 32cae56 commit 50d2178
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/x6/src/addon/selection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class Selection extends View<Selection.EventArgs> {
options,
}: Collection.EventArgs['node:change:position']) {
const { showNodeSelectionBox, pointerEvents } = this.options
const { ui, selection } = options
const { ui, selection, translateBy } = options
let allowTranslating = !this.translating

/* Scenarios where this method is not called:
Expand All @@ -137,6 +137,9 @@ export class Selection extends View<Selection.EventArgs> {
(showNodeSelectionBox !== true || pointerEvents === 'none')
allowTranslating = allowTranslating && ui && !selection

// Avoid circular calls of child nodes
allowTranslating = allowTranslating && translateBy && node.id === translateBy

if (allowTranslating) {
this.translating = true
const current = node.position()
Expand Down

0 comments on commit 50d2178

Please sign in to comment.