Skip to content

Commit

Permalink
load() force 1x1 default
Browse files Browse the repository at this point in the history
* more fix gridstack#2669
  • Loading branch information
adumesny committed Jun 24, 2024
1 parent ab3340c commit 7907bf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,9 @@ export class GridStack {
items = Utils.cloneDeep(items); // so we can mod
const column = this.getColumn();

// make sure size 1x1 (default) is present as it may need to override current sizes
items.forEach(n => { n.w = n.w || 1; n.h = n.h || 1 });

// if we have a mix of new items without coordinates and existing items, separate them out so they can be added after #2639
let addAfter = items.filter(n => (n.x === undefined || n.y === undefined) && !Utils.find(this.engine.nodes, n.id));
if (addAfter.length && addAfter.length !== items.length) {
Expand Down

0 comments on commit 7907bf3

Please sign in to comment.