From 844c845f8f67bdb80bec12e662689dd278ea5dfb Mon Sep 17 00:00:00 2001 From: Alex Vovchuk Date: Mon, 19 Aug 2024 14:36:18 -0600 Subject: [PATCH] DragOvering the DraggableObject from one SortableObjects to another not working properly --- ember-drag-drop/src/components/draggable-object.js | 7 ++++--- ember-drag-drop/src/services/drag-coordinator.js | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ember-drag-drop/src/components/draggable-object.js b/ember-drag-drop/src/components/draggable-object.js index 42edcf6..a5f4b0f 100644 --- a/ember-drag-drop/src/components/draggable-object.js +++ b/ember-drag-drop/src/components/draggable-object.js @@ -137,9 +137,10 @@ export default Component.extend({ if(this.get('dragEndAction')) { this.get('dragEndAction')(obj, event); } - if (this.get('dragHandle')) { - this.set('dragReady', false); - } + + // This prevents the situation where, when you release an element and the mouse cursor is still in the DOM + // that triggers the item's draggable state, you can move the item again without having to move the mouse out and back over the item. + this.set('dragReady', false); }, drag(event) { diff --git a/ember-drag-drop/src/services/drag-coordinator.js b/ember-drag-drop/src/services/drag-coordinator.js index e1bfede..42834ed 100644 --- a/ember-drag-drop/src/services/drag-coordinator.js +++ b/ember-drag-drop/src/services/drag-coordinator.js @@ -77,7 +77,7 @@ export default Service.extend({ draggingOver(event, emberObject) { const currentOffsetItem = this.get('currentOffsetItem'); const pos = this.relativeClientPosition(emberObject.element, event); - const hasSameSortingScope = this.get('currentDragItem.sortingScope') === emberObject.get('sortingScope'); + const hasSameSortingScope = this.get('currentDragItem').get('sortingScope') === emberObject.get('sortingScope'); let moveDirections = []; if (!this.get('lastEvent')) {