Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DragOvering the DraggableObject from one SortableObjects to another not working properly #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ember-drag-drop/src/components/draggable-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion ember-drag-drop/src/services/drag-coordinator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why separate these? In the new version you'd get an error if the first object is undefined.

const hasSameSortingScope = this.get('currentDragItem').get('sortingScope') === emberObject.get('sortingScope');
let moveDirections = [];

if (!this.get('lastEvent')) {
Expand Down