Skip to content

Commit

Permalink
actions/drop/DopEvent: fix for failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
taye committed Mar 22, 2018
1 parent 0d84db4 commit 19bbc29
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/actions/drop/DropEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import * as arr from '../../utils/arr';

export default class DropEvent {
constructor (dropStatus, dragEvent, type) {
const { element, dropzone } = type === 'deactivate'
? { element: null, dropzone: null }
: type === 'dragleave'
? dropStatus.prev
: dropStatus.cur;
const { element, dropzone } = type === 'dragleave'
? dropStatus.prev
: dropStatus.cur;

this.type = type;
this.target = element;
Expand Down Expand Up @@ -40,10 +38,6 @@ export default class DropEvent {

this.stopImmediatePropagation();

if (this.type === 'dragenter') {
this.dropzone.fire(new DropEvent(dropStatus, this.dragEvent, 'dragleave'));
}

if (this.type === 'dropactivate') {
const activeDrops = dropStatus.activeDrops;
const index = arr.findIndex(activeDrops, ({ dropzone, element }) =>
Expand All @@ -61,6 +55,9 @@ export default class DropEvent {

this.dropzone.fire(deactivateEvent);
}
else {
this.dropzone.fire(new DropEvent(dropStatus, this.dragEvent, 'dragleave'));
}
}

preventDefault () {}
Expand Down

0 comments on commit 19bbc29

Please sign in to comment.