From 4a3254992e282308577787efccbfd47fd81d783e Mon Sep 17 00:00:00 2001 From: Filip Kujavec Date: Mon, 23 Jun 2025 13:34:23 +0200 Subject: [PATCH] fix: incorrect node._id check --- src/gridstack-engine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridstack-engine.ts b/src/gridstack-engine.ts index b41a404b..f85ac332 100644 --- a/src/gridstack-engine.ts +++ b/src/gridstack-engine.ts @@ -417,7 +417,7 @@ export class GridStackEngine { // remember it's position & width so we can restore back (1 -> 12 column) #1655 #1985 // IFF we're not in the middle of column resizing! const saveOrig = (node.x || 0) + (node.w || 1) > this.column; - if (saveOrig && this.column < this.defaultColumn && !this._inColumnResize && !this.skipCacheUpdate && (node._id ?? false) && this.findCacheLayout(node, this.defaultColumn) === -1) { + if (saveOrig && this.column < this.defaultColumn && !this._inColumnResize && !this.skipCacheUpdate && node._id != null && this.findCacheLayout(node, this.defaultColumn) === -1) { const copy = {...node}; // need _id + positions if (copy.autoPosition || copy.x === undefined) { delete copy.x; delete copy.y; } else copy.x = Math.min(this.defaultColumn - 1, copy.x);