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 authored and Mauricio Palma committed May 7, 2018
1 parent 562e4df commit 5b45225
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 5b45225

Please sign in to comment.