Skip to content
Snippets Groups Projects
Commit 10c51fa4 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Only null out asset drag if you were previously dragging

This was causing a re-render for anything using the `drop-area-hoc`
parent b18b428a
No related branches found
No related tags found
No related merge requests found
......@@ -55,13 +55,15 @@ class SpriteSelectorItem extends React.Component {
window.removeEventListener('mousemove', this.handleMouseMove);
window.removeEventListener('touchend', this.handleMouseUp);
window.removeEventListener('touchmove', this.handleMouseMove);
this.props.onDrag({
img: null,
currentOffset: null,
dragging: false,
dragType: null,
index: null
});
if (this.props.dragging) {
this.props.onDrag({
img: null,
currentOffset: null,
dragging: false,
dragType: null,
index: null
});
}
setTimeout(() => {
this.noClick = false;
});
......@@ -156,6 +158,7 @@ SpriteSelectorItem.propTypes = {
body: PropTypes.string
}),
dragType: PropTypes.string,
dragging: PropTypes.bool,
id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
index: PropTypes.number,
name: PropTypes.string,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment