Skip to content

Commit 1427227

Browse files
committed
1835 tweak: Layout incorrectly restored when node has a minimum width
1 parent b6d9cc3 commit 1427227

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

doc/CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Change log
55
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
66
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
77

8+
- [4.2.7 (2021-9-12)](#427-2021-9-12)
89
- [4.2.6 (2021-7-11)](#426-2021-7-11)
910
- [4.2.5 (2021-5-31)](#425-2021-5-31)
1011
- [4.2.4 (2021-5-29)](#424-2021-5-29)
@@ -59,6 +60,12 @@ Change log
5960
- [v0.1.0 (2014-11-18)](#v010-2014-11-18)
6061

6162
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
63+
64+
## 4.2.7 (2021-9-12)
65+
66+
* fix [#1817](https://github.com/gridstack/gridstack.js/issues/1817) Enable passing of DragEvent to gridstack dropped event. Thanks [@onepartsam](https://github.com/onepartsam)
67+
* fix [#1835](https://github.com/gridstack/gridstack.js/issues/1835) Layout incorrectly restored when node has a minimum width. Thanks [@hssm](https://github.com/hssm)
68+
6269
## 4.2.6 (2021-7-11)
6370

6471
* fix [#1784](https://github.com/gridstack/gridstack.js/issues/1784) `removable:true` working by itself (without needing `acceptWidgets:true`)

src/gridstack-engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export class GridStackEngine {
345345

346346
if (node.maxW) { node.w = Math.min(node.w, node.maxW); }
347347
if (node.maxH) { node.h = Math.min(node.h, node.maxH); }
348-
if (node.minW && node.minW < this.column) { node.w = Math.max(node.w, node.minW); }
348+
if (node.minW && node.minW <= this.column) { node.w = Math.max(node.w, node.minW); }
349349
if (node.minH) { node.h = Math.max(node.h, node.minH); }
350350

351351
if (node.w > this.column) {

src/gridstack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ export class GridStack {
970970

971971
// support legacy call for now ?
972972
if (arguments.length > 2) {
973-
console.warn('gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update({x, w, content, ...})`. It will be removed soon');
973+
console.warn('gridstack.ts: `update(el, x, y, w, h)` is deprecated. Use `update(el, {x, w, content, ...})`. It will be removed soon');
974974
// eslint-disable-next-line prefer-rest-params
975975
let a = arguments, i = 1;
976976
opt = { x:a[i++], y:a[i++], w:a[i++], h:a[i++] };

0 commit comments

Comments
 (0)