Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change log
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [9.1.1-dev (TBD)](#911-dev-tbd)
- [9.1.1 (2023-09-06)](#911-2023-09-06)
- [9.1.0 (2023-09-04)](#910-2023-09-04)
- [9.0.2 (2023-08-29)](#902-2023-08-29)
Expand Down Expand Up @@ -97,6 +98,9 @@ Change log

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 9.1.1-dev (TBD)
* fix [#2449](https://github.com/gridstack/gridstack.js/issues/2449) full grid maxRow fix

## 9.1.1 (2023-09-06)
* fix [#2435](https://github.com/gridstack/gridstack.js/issues/2435) directionCollideCoverage() tweaks
* fix resizeToContent() to handle node.h (using when cellHeight changes or we resize) vs DOM sizing (rest of the time)
Expand Down
5 changes: 3 additions & 2 deletions src/gridstack-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,8 +591,9 @@ export class GridStackEngine {
});
if (!clonedNode) return false;

// check if we're covering 50% collision and could move
let canMove = clone.moveNode(clonedNode, o) && clone.getRow() <= this.maxRow;
// check if we're covering 50% collision and could move, while still being under maxRow or at least not making it worse
// (case where widget was somehow added past our max #2449)
let canMove = clone.moveNode(clonedNode, o) && clone.getRow() <= Math.max(this.getRow(), this.maxRow);
// else check if we can force a swap (float=true, or different shapes) on non-resize
if (!canMove && !o.resizing && o.collide) {
let collide = o.collide.el.gridstackNode; // find the source node the clone collided with at 50%
Expand Down