diff --git a/demo/nested.html b/demo/nested.html index 0300a3695..da77fc270 100644 --- a/demo/nested.html +++ b/demo/nested.html @@ -55,6 +55,7 @@

Nested grids demo

minRow: 2, // don't collapse when empty acceptWidgets: true, id: 'main', + resizable: { handles: 'se,e,s,sw,w'}, subGridOpts: subOptions, // all sub grids will default to those children: [ {x:0, y:0, content: 'regular item'}, diff --git a/doc/CHANGES.md b/doc/CHANGES.md index e2cc70382..4404c1f08 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -120,6 +120,7 @@ Change log * fix: [#2859](https://github.com/gridstack/gridstack.js/pull/2859) re-enabled tests and fix numerous issues found (see CL). Also thank you [lmartorella](https://github.com/lmartorella) for getting me going and starting it. * fix: [#2851](https://github.com/gridstack/gridstack.js/pull/2851) added support for custom max layout saving - Thank you [lmartorella](https://github.com/lmartorella) * fix: [#2492](https://github.com/gridstack/gridstack.js/issues/2492) loading same layout with overlapping widget fix. v10.3.0 regression. +* fix: [#2864](https://github.com/gridstack/gridstack.js/issues/2864) added `GridStackOptions.layout` for nested grid reflow during resize. default to 'list'. ## 11.0.1 (2024-10-21) * fix: [#2834](https://github.com/gridstack/gridstack.js/pull/2834) v11 angular missing package.json diff --git a/spec/e2e/html/2576_insert_column_shift_content.html b/spec/e2e/html/2576_insert_column_shift_content.html index 3ccc51111..95e62b4cd 100644 --- a/spec/e2e/html/2576_insert_column_shift_content.html +++ b/spec/e2e/html/2576_insert_column_shift_content.html @@ -5,7 +5,7 @@ - Column insert bug #2578 + Column insert bug #2576 diff --git a/src/gridstack.ts b/src/gridstack.ts index 992f33d9b..af9120a77 100644 --- a/src/gridstack.ts +++ b/src/gridstack.ts @@ -1786,7 +1786,7 @@ export class GridStack { let columnChanged = false; if (this._autoColumn && this.parentGridNode) { if (this.opts.column !== this.parentGridNode.w) { - this.column(this.parentGridNode.w, 'none'); + this.column(this.parentGridNode.w, this.opts.layout || 'none'); columnChanged = true; } } else { diff --git a/src/types.ts b/src/types.ts index 448012aa7..f433ba57e 100644 --- a/src/types.ts +++ b/src/types.ts @@ -191,6 +191,9 @@ export interface GridStackOptions { /** additional widget class (default?: 'grid-stack-item') */ itemClass?: string; + /** re-layout mode when we're a subgrid and we are being resized. default to 'list' */ + layout?: ColumnOptions; + /** true when widgets are only created when they scroll into view (visible) */ lazyLoad?: boolean;