@internal called when the item is leaving our area, stop tracking if we had moving item
(e: MouseEvent, calledByEnter = false)
| 110 | |
| 111 | /** @internal called when the item is leaving our area, stop tracking if we had moving item */ |
| 112 | protected _mouseLeave(e: MouseEvent, calledByEnter = false): void { |
| 113 | // console.log(`${count++} Leave ${this.el.id}`); // TEST |
| 114 | if (!DDManager.dragElement || DDManager.dropElement !== this) return; |
| 115 | e.preventDefault(); |
| 116 | e.stopPropagation(); |
| 117 | // stop the old grid's auto-scroll only when entering a new grid; if leaving to empty space keep scrolling until mouseup |
| 118 | if (calledByEnter) DDManager.dragElement._stopScrolling(); |
| 119 | |
| 120 | const ev = Utils.initEvent<DragEvent>(e, { target: this.el, type: 'dropout' }); |
| 121 | if (this.option.out) { |
| 122 | this.option.out(ev, this._ui(DDManager.dragElement)) |
| 123 | } |
| 124 | this.triggerEvent('dropout', ev); |
| 125 | |
| 126 | if (DDManager.dropElement === this) { |
| 127 | delete DDManager.dropElement; |
| 128 | // console.log('not tracking'); // TEST |
| 129 | |
| 130 | // if we're still over a parent droppable, send it an enter as we don't get one from leaving nested children |
| 131 | if (!calledByEnter) { |
| 132 | let parentDrop: DDDroppable; |
| 133 | let parent: DDElementHost = this.el.parentElement; |
| 134 | while (!parentDrop && parent) { |
| 135 | parentDrop = parent.ddElement?.ddDroppable; |
| 136 | parent = parent.parentElement; |
| 137 | } |
| 138 | if (parentDrop) { |
| 139 | parentDrop._mouseEnter(e); |
| 140 | } |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | /** item is being dropped on us - called by the drag mouseup handler - this calls the client drop event */ |
| 146 | public drop(e: MouseEvent): void { |
no test coverage detected