Skip to content

Commit

Permalink
TS: fix to prev change (failed test)
Browse files Browse the repository at this point in the history
  • Loading branch information
adumesny committed Aug 17, 2020
1 parent d26fa96 commit 6e8b5dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gridstack-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ export class GridStackEngine {
this.removedNodes.push(node);
}
node._id = null; // hint that node is being removed
this.nodes.splice(this.nodes.findIndex(n => n === node), 1);
// TODO: .splice(findIndex(),1) would be faster but apparently there are cases we have 2 instances ! (see spec 'load add new, delete others')
this.nodes = this.nodes.filter(n => n !== node);
if (!this.float) {
this._packNodes();
}
Expand Down

0 comments on commit 6e8b5dc

Please sign in to comment.