From 6e8b5dc69925528247e21397a03e0a479230ede7 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sun, 16 Aug 2020 19:45:39 -0700 Subject: [PATCH] TS: fix to prev change (failed test) --- src/gridstack-engine.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gridstack-engine.ts b/src/gridstack-engine.ts index 1d0c05457..0c4c04715 100644 --- a/src/gridstack-engine.ts +++ b/src/gridstack-engine.ts @@ -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(); }