Skip to content

Commit 237c9c7

Browse files
committed
more Safari DD fixes
doc update for #1684
1 parent 1d077e7 commit 237c9c7

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
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)

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)