Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: avoid infinite loops when dragging elements on themselves
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed May 4, 2018
1 parent 8f7cf2b commit a2fe54e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/store/command/element-location-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ export class ElementLocationCommand extends ElementCommand {
return false;
}

// Do not try to add an element to itself
if (this.element === this.parent) {
return false;
}

this.element.setParent(this.parent, this.slotId, this.index);
this.memorizeElementIds();

Expand Down

0 comments on commit a2fe54e

Please sign in to comment.