From cb80ee2dd96a5e7f134110cf281490b422849ee2 Mon Sep 17 00:00:00 2001 From: Alain Dumesny Date: Sun, 10 Sep 2023 12:08:32 -0700 Subject: [PATCH] nested grids now support `sizeToContent` * nested grids now support `sizeToContent` to size themselves to how many sub items they contain - Thank you [@Helix](https://gridstackjs.slack.com/team/U05QT7G8H7T) for sponsoring this! --- demo/nested.html | 7 +++--- doc/CHANGES.md | 5 +++-- src/gridstack.ts | 58 +++++++++++++++++++++++++++++++----------------- src/types.ts | 8 +++---- 4 files changed, 49 insertions(+), 29 deletions(-) diff --git a/demo/nested.html b/demo/nested.html index ef9f63d3a..854a1f877 100644 --- a/demo/nested.html +++ b/demo/nested.html @@ -13,8 +13,9 @@

Nested grids demo

This example shows v5.x dragging between nested grids (dark yellow) and parent grid (bright yellow.)
+ Use v9.2 sizeToContent:true on first subgrid item parent to grow/shrink as needed, while leaving leaf green items unchanged.
Uses v3.1 API to load the entire nested grid from JSON.
- Nested grids uses new column:'auto' to keep items same size during resize.

+ Nested grids uses v5 column:'auto' to keep items same size during resize.

Add Widget Add Widget Grid1 Add Widget Grid2 @@ -33,7 +34,7 @@

Nested grids demo