Skip to content

Commit d9c16a6

Browse files
committed
nested grid resizing fix
fix gridstack#1604
1 parent e17a4f6 commit d9c16a6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

demo/nested.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Nested grids demo (ES6)</title>
88
<link rel="stylesheet" href="demo.css"/>
99
<link rel="stylesheet" href="../dist/gridstack-extra.min.css"/>
10-
<script src="../dist/gridstack-jq.js"></script>
10+
<script src="../dist/gridstack-h5.js"></script>
1111
<style type="text/css">
1212
.grid-stack .grid-stack {
1313
background: rgba(255, 255, 255, 0.3);
@@ -21,7 +21,7 @@
2121
<div class="container-fluid">
2222
<h1>Nested grids demo</h1>
2323
<p>This example uses new v3.1 API to load the entire nested grid from JSON, and shows dragging between nested grid items (pink) vs dragging higher grid items (green)</p>
24-
<p>Note: initial v3 HTML5 release doesn't support 'dragOut:false' constrain so this uses JQ version for now, otherwise recommend you use h5 version.</p>
24+
<p>Note: initial v3 HTML5 release doesn't support 'dragOut:false' constrain so use jq version if you need that.</p>
2525
<a class="btn btn-primary" onClick="addNewWidget('.nested1')" href="#">Add Widget Grid1</a>
2626
<a class="btn btn-primary" onClick="addNewWidget('.nested2')" href="#">Add Widget Grid2</a>
2727
<br><br>

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Change log
5555
- new grid option `cellHeightThrottle` (100ms) to control throttle of auto sizing triggers
5656
- fix [1600](https://github.com/gridstack/gridstack.js/issues/1600) height too small with `cellHeight:auto` loading in 1 column. Now detect we load at 1 column and size accordingly (default 'auto' could make big 700x700 cells, so explicit px might still be wanted)
5757
- fix [1538](https://github.com/gridstack/gridstack.js/issues/1538) loading nested into small size and sizing back up
58+
- fix [1604](https://github.com/gridstack/gridstack.js/issues/1604) nested grid resizing fix
5859

5960
## 3.2.0 (2021-1-25)
6061

src/h5/dd-resizable-handle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export class DDResizableHandle {
6464

6565
/** @internal called on mouse down on us: capture move on the entire document (mouse might not stay on us) until we release the mouse */
6666
private _mouseDown(e: MouseEvent): void {
67+
e.preventDefault();
6768
this.mouseDownEvent = e;
6869
document.addEventListener('mousemove', this._mouseMove, true); // capture, not bubble
6970
document.addEventListener('mouseup', this._mouseUp);

0 commit comments

Comments
 (0)