Skip to content

Commit fcab1d1

Browse files
authored
Merge pull request #1740 from adumesny/master
doc updates
2 parents abdeb3b + 237c9c7 commit fcab1d1

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

doc/CHANGES.md

Lines changed: 5 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.1-dev](#421-dev)
89
- [4.2.1 (2021-4-18)](#421-2021-4-18)
910
- [4.2.0 (2021-4-11)](#420-2021-4-11)
1011
- [4.1.0 (2021-4-7)](#410-2021-4-7)
@@ -54,6 +55,10 @@ Change log
5455
- [v0.1.0 (2014-11-18)](#v010-2014-11-18)
5556

5657
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
58+
## 4.2.1-dev
59+
60+
- fix [#1684](https://github.com/gridstack/gridstack.js/issues/1684) mac Safari H5 draggable broken in 4.0.1. Thanks [@wurambo](https://github.com/wurambo)
61+
5762
## 4.2.1 (2021-4-18)
5863

5964
- fix [#1700](https://github.com/gridstack/gridstack.js/issues/1700) JQ nested grid drag fix broken in 4.0.3 (but much older underlying issue)

doc/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ gap between grid item and content (default?: 10). This will set all 4 sides and
491491

492492
### `movable(el, val)`
493493

494-
Enables/Disables moving.
494+
Enables/Disables dragging by the user of specific grid element. If you want all items, and have it affect future items, use enableMove() instead. No-op for static grids.
495+
IF you are looking to prevent an item from moving (due to being pushed around by another during collision) use locked property instead.
495496

496497
- `el` - widget to modify
497498
- `val` - if `true` widget will be draggable.
@@ -516,7 +517,7 @@ Parameters:
516517

517518
### `resizable(el, val)`
518519

519-
Enables/Disables resizing.
520+
Enables/Disables user resizing of specific grid element. If you want all items, and have it affect future items, use enableResize() instead. No-op for static grids.
520521

521522
- `el` - widget to modify
522523
- `val` - if `true` widget will be resizable.

src/gridstack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,13 +1468,14 @@ export class GridStack {
14681468
public static setupDragIn(dragIn?: string, dragInOptions?: DDDragInOpt): void { /* implemented in gridstack-dd.ts */ }
14691469

14701470
/**
1471-
* Enables/Disables moving of specific grid elements. If you want all items, and have it stay, use enableMove() instead. No-op for static grids.
1471+
* Enables/Disables dragging by the user of specific grid element. If you want all items, and have it affect future items, use enableMove() instead. No-op for static grids.
1472+
* IF you are looking to prevent an item from moving (due to being pushed around by another during collision) use locked property instead.
14721473
* @param els widget or selector to modify.
14731474
* @param val if true widget will be draggable.
14741475
*/
14751476
public movable(els: GridStackElement, val: boolean): GridStack { return this }
14761477
/**
1477-
* Enables/Disables resizing of specific grid elements. If you want all items, and have it stay, use enableResize() instead. No-op for static grids.
1478+
* Enables/Disables user resizing of specific grid element. If you want all items, and have it affect future items, use enableResize() instead. No-op for static grids.
14781479
* @param els widget or selector to modify
14791480
* @param val if true widget will be resizable.
14801481
*/

src/h5/dd-droppable.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,14 @@ export class DDDroppable extends DDBaseImplement implements HTMLElementExtendOpt
105105

106106
/** @internal called when the item is leaving our area, stop tracking if we had moving item */
107107
private _dragLeave(event: DragEvent): void {
108+
109+
// ignore leave events on our children (get when starting to drag our items)
108110
// Note: Safari Mac has null relatedTarget which causes #1684 so check if DragEvent is inside the grid instead
109111
if (!event.relatedTarget) {
110112
const { bottom, left, right, top } = this.el.getBoundingClientRect();
111113
if (event.x < right && event.x > left && event.y < bottom && event.y > top) return;
112-
}
113-
if (this.el.contains(event.relatedTarget as HTMLElement)) return;
114+
} else if (this.el.contains(event.relatedTarget as HTMLElement)) return;
115+
114116
this._removeLeaveCallbacks();
115117
if (this.moving) {
116118
event.preventDefault();

0 commit comments

Comments
 (0)