Skip to content

Commit e7065dc

Browse files
authored
Merge pull request #1564 from adumesny/develop
tweak to saving nested grids with content
2 parents bcef5c5 + 3910543 commit e7065dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gridstack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ export class GridStack {
427427
// check for HTML content as well
428428
if (saveContent) {
429429
list.forEach(n => {
430-
if (n.el) {
430+
if (n.el && !n.subGrid) { // sub-grid are saved differently, not plain content
431431
let sub = n.el.querySelector('.grid-stack-item-content');
432432
n.content = sub ? sub.innerHTML : undefined;
433433
if (!n.content) delete n.content;
@@ -442,7 +442,7 @@ export class GridStack {
442442
// check for nested grid
443443
list.forEach(n => {
444444
if (n.subGrid) {
445-
n.subGrid = (n.subGrid as GridStack).save(saveContent, true) as GridStackOptions;
445+
n.subGrid = (n.subGrid as GridStack).save(saveContent, saveGridOpt) as GridStackOptions;
446446
}
447447
})
448448

0 commit comments

Comments
 (0)