Do not call onDrop if newIndex is null
This commit is contained in:
1 parent
417e439a38
commit
e1aa283fc9
1 file changed
+4
-2
@@ -26,8 +26,10 @@ const SortableHOC = function (WrappedComponent) {
|
||||
return a.top - b.top;
|
||||
});
|
||||
} else if (!newProps.dragInfo.dragging && this.props.dragInfo.dragging) {
|
||||
this.props.onDrop(Object.assign({},
|
||||
this.props.dragInfo, {newIndex: this.getMouseOverIndex()}));
|
||||
const newIndex = this.getMouseOverIndex();
|
||||
if (newIndex !== null) {
|
||||
this.props.onDrop(Object.assign({}, this.props.dragInfo, {newIndex}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user