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/)*

- [6.0.2-dev (TBD)](#602-dev-tbd)
- [6.0.2 (2022-09-23)](#602-2022-09-23)
- [6.0.1 (2022-08-27)](#601-2022-08-27)
- [6.0.0 (2022-08-21)](#600-2022-08-21)
Expand Down Expand Up @@ -71,6 +72,9 @@ Change log

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

## 6.0.2-dev (TBD)
* fixed [#2055](https://github.com/gridstack/gridstack.js/issues/2055) maxRow=1 resize outside

## 6.0.2 (2022-09-23)
* fixed [#2034](https://github.com/gridstack/gridstack.js/issues/2034) `removeWidget()` breaking resize handle feedback
* fixed [#2043](https://github.com/gridstack/gridstack.js/issues/2043) when swapping shapes in maxRow grid, make sure we still check for 50% coverage
Expand Down
8 changes: 4 additions & 4 deletions src/gridstack-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ export class GridStackEngine {
if (!clonedNode) return false;

// check if we're covering 50% collision and could move
let canMove = clone.moveNode(clonedNode, o);
// make sure we are still valid grid max, else check if we can force a swap (float=true, or different shapes) on non-resize
if (!o.resizing && canMove && o.collide && this.float && clone.getRow() > this.maxRow) {
let collide = o.collide.el.gridstackNode; // find the source node the clone collided with
let canMove = clone.moveNode(clonedNode, o) && clone.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%
if (this.swap(node, collide)) { // swaps and mark dirty
this._notify();
return true;
Expand Down