Skip to content

Commit ddc34d6

Browse files
authored
Merge pull request #1557 from adumesny/develop
fixed no-drop cursor on windows
2 parents 2963bf6 + aaa167c commit ddc34d6

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

doc/CHANGES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ Change log
4646
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
4747
## 3.1.3-dev
4848

49-
- TBD
49+
- fix [1557](https://github.com/gridstack/gridstack.js/pull/1557) fixed no-drop cursor on windows when dragging within a default grid (no external drag in)
5050

5151
## 3.1.3 (2021-1-2)
5252

53-
- fix [1535](https://github.com/gridstack/gridstack.js/issues/1535) use batchUpdate() around grid init to make sure gs-y attributes are respected.
5453
- fix [1540](https://github.com/gridstack/gridstack.js/issues/1540) Safari H5 drag&drop fixed
54+
- fix [1535](https://github.com/gridstack/gridstack.js/issues/1535) use batchUpdate() around grid init to make sure gs-y attributes are respected.
5555
- fix [1545](https://github.com/gridstack/gridstack.js/issues/1545) `disableMove()` correctly prevents drag later (remove events and draggable attribute)
5656
- fix [1546](https://github.com/gridstack/gridstack.js/issues/1546) resize no longer delayed, which caused race conditions errors
5757
- fix [1001](https://github.com/gridstack/gridstack.js/issues/1001) resizing near bottom/top needs to auto-scroll/. thanks [@hbcarlos](https://github.com/hbcarlos)!

src/gridstack-dd.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,16 @@ export abstract class GridStackDD extends GridStackDDI {
7777

7878
/** @internal called to add drag over support to support widgets */
7979
GridStack.prototype._setupAcceptWidget = function(): GridStack {
80-
if (this.opts.staticGrid || !this.opts.acceptWidgets) return this;
80+
if (this.opts.staticGrid) return this;
81+
82+
// if we don't accept external widgets (default) we still need to accept dragging within our
83+
// list of items (else we get a no-drop icon on windows)
84+
if (!this.opts.acceptWidgets) {
85+
GridStackDD.get().droppable(this.el, {
86+
accept: (el: GridItemHTMLElement) => el.gridstackNode && el.gridstackNode.grid === this
87+
})
88+
return this;
89+
}
8190

8291
let onDrag = (event, el: GridItemHTMLElement) => {
8392
let node = el.gridstackNode;

0 commit comments

Comments
 (0)