Skip to content

Commit f5d242a

Browse files
committed
Pass stub object on handleDragEnd to prevent crash
1 parent 3adf4c5 commit f5d242a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/draggable.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ module.exports = React.createClass({
518518
if(e.targetTouches){
519519
this.setState({touchIdentifier: e.targetTouches[0].identifier});
520520
}
521-
521+
522522
// Make it possible to attach event handlers on top of this one
523523
this.props.onMouseDown(e);
524524

@@ -565,7 +565,7 @@ module.exports = React.createClass({
565565
// Short circuit if this is not the correct touch event
566566
if(e.changedTouches && (e.changedTouches[0].identifier != this.state.touchIdentifier)){
567567
return;
568-
}
568+
}
569569

570570
removeUserSelectStyles(this);
571571

@@ -609,7 +609,7 @@ module.exports = React.createClass({
609609

610610
// Call event handler. If it returns explicit false, cancel.
611611
var shouldUpdate = this.props.onDrag(e, createUIEvent(this));
612-
if (shouldUpdate === false) return this.handleDragEnd();
612+
if (shouldUpdate === false) return this.handleDragEnd({});
613613

614614
// Update transform
615615
this.setState({

0 commit comments

Comments
 (0)