Skip to content

Commit

Permalink
yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreardon committed May 9, 2018
1 parent 2ebe6cc commit 5521315
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/view/draggable/connected-draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
crossAxisMoveForward as crossAxisMoveForwardAction,
crossAxisMoveBackward as crossAxisMoveBackwardAction,
drop as dropAction,
cancel as cancelAction,
dropAnimationFinished as dropAnimationFinishedAction,
moveByWindowScroll as moveByWindowScrollAction,
} from '../../state/action-creators';
Expand Down Expand Up @@ -227,7 +226,6 @@ const mapDispatchToProps: DispatchProps = {
moveByWindowScroll: moveByWindowScrollAction,
drop: dropAction,
dropAnimationFinished: dropAnimationFinishedAction,
cancel: cancelAction,
};

// Leaning heavily on the default shallow equality checking
Expand Down
2 changes: 0 additions & 2 deletions src/view/draggable/draggable-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
crossAxisMoveForward,
crossAxisMoveBackward,
drop,
cancel,
dropAnimationFinished,
} from '../../state/action-creators';
import type {
Expand Down Expand Up @@ -123,7 +122,6 @@ export type DispatchProps = {|
crossAxisMoveForward: typeof crossAxisMoveForward,
crossAxisMoveBackward: typeof crossAxisMoveBackward,
drop: typeof drop,
cancel: typeof cancel,
dropAnimationFinished: typeof dropAnimationFinished,
|}

Expand Down
6 changes: 3 additions & 3 deletions src/view/draggable/draggable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ export default class Draggable extends Component<Props> {
this.props.moveByWindowScroll({ viewport: getViewport() });
}

onDrop = (reason: DropReason) => {
onDrop = () => {
this.throwIfCannotDrag();
this.props.drop();
this.props.drop({ reason: 'DROP' });
}

onCancel = () => {
// Not checking if drag is enabled.
// Cancel is an escape mechanism
this.props.cancel();
this.props.drop({ reason: 'CANCEL' });
}

// React calls ref callback twice for every render
Expand Down

0 comments on commit 5521315

Please sign in to comment.