Skip to content

Commit a51fe47

Browse files
authored
Merge pull request #2713 from adumesny/master
load() force 1x1 default
2 parents 6cee6d2 + 7907bf3 commit a51fe47

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gridstack.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,9 @@ export class GridStack {
700700
items = Utils.cloneDeep(items); // so we can mod
701701
const column = this.getColumn();
702702

703+
// make sure size 1x1 (default) is present as it may need to override current sizes
704+
items.forEach(n => { n.w = n.w || 1; n.h = n.h || 1 });
705+
703706
// if we have a mix of new items without coordinates and existing items, separate them out so they can be added after #2639
704707
let addAfter = items.filter(n => (n.x === undefined || n.y === undefined) && !Utils.find(this.engine.nodes, n.id));
705708
if (addAfter.length && addAfter.length !== items.length) {

0 commit comments

Comments
 (0)