Skip to content

Commit 43ec501

Browse files
committed
doc update
1 parent 6837725 commit 43ec501

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ gridstack.js API
5757
- [`removeWidget(el, removeDOM = true, triggerEvent = true)`](#removewidgetel-removedom--true-triggerevent--true)
5858
- [`removeAll(removeDOM = true)`](#removeallremovedom--true)
5959
- [`resizable(el, val)`](#resizableel-val)
60+
- [`resizeToContent(el: GridItemHTMLElement, useAttrSize = false)`](#resizetocontentel-griditemhtmlelement-useattrsize--false)
6061
- [`save(saveContent = true, saveGridOpt = false): GridStackWidget[] | GridStackOptions`](#savesavecontent--true-savegridopt--false-gridstackwidget--gridstackoptions)
6162
- [`setAnimation(doAnimate)`](#setanimationdoanimate)
6263
- [`setStatic(staticValue)`](#setstaticstaticvalue)
@@ -563,6 +564,12 @@ Enables/Disables user resizing of specific grid element. If you want all items,
563564
- `el` - widget to modify
564565
- `val` - if `true` widget will be resizable.
565566

567+
### `resizeToContent(el: GridItemHTMLElement, useAttrSize = false)`
568+
569+
Updates widget height to match the content height to avoid v-scrollbar or dead space.
570+
Note: this assumes only 1 child under `resizeToContentParent='.grid-stack-item-content'` (sized to gridItem minus padding) that is at the entire content size wanted.
571+
- `useAttrSize` set to `true` if GridStackNode.h should be used instead of actual container height when we don't need to wait for animation to finish to get actual DOM heights
572+
566573
### `save(saveContent = true, saveGridOpt = false): GridStackWidget[] | GridStackOptions`
567574

568575
saves the current layout returning a list of widgets for serialization which might include any nested grids.

0 commit comments

Comments
 (0)