Skip to content

Commit

Permalink
fix: 🐛 translateSelectionNodes is only triggered manually
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector committed Jun 15, 2021
1 parent 75a58ff commit 6d445da
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/x6/src/addon/selection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ export class Selection extends View<Selection.EventArgs> {
node,
options,
}: Collection.EventArgs['node:change:position']) {
if (this.options.showNodeSelectionBox !== true && !this.translating) {
// Executes only if showNodeSelectionBox is false and is triggered manually
if (
this.options.showNodeSelectionBox !== true &&
!this.translating &&
options.ui
) {
this.translating = true
const current = node.position()
const previous = node.previous('position')!
Expand Down Expand Up @@ -538,7 +543,7 @@ export class Selection extends View<Selection.EventArgs> {

protected notifyBoxEvent<
K extends keyof Selection.BoxEventArgs,
T extends JQuery.TriggeredEvent,
T extends JQuery.TriggeredEvent
>(name: K, e: T, x: number, y: number) {
const data = this.getEventData<EventData.SelectionBox>(e)
const view = data.activeView
Expand Down

0 comments on commit 6d445da

Please sign in to comment.