Fix context menu coming up when dragging

This commit is contained in:
Paul Kaplan committed 2019-06-19 11:27:00 -04:00
1 parent 8611c9ff1a
commit abdeb8dbdb
2 files changed
+3 -2

No files matched your search

@@ -23,7 +23,7 @@ const SpriteSelectorItem = props => (
onMouseDown: props.onMouseDown,
onTouchStart: props.onMouseDown
}}
disable={props.dragging}
disable={props.preventContextMenu}
id={`${props.name}-${contextMenuId}`}
>
{typeof props.number === 'undefined' ? null : (
@@ -91,7 +91,6 @@ SpriteSelectorItem.propTypes = {
className: PropTypes.string,
costumeURL: PropTypes.string,
details: PropTypes.string,
dragging: PropTypes.bool,
name: PropTypes.string.isRequired,
number: PropTypes.number,
onClick: PropTypes.func,
@@ -101,6 +100,7 @@ SpriteSelectorItem.propTypes = {
onMouseDown: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func,
preventContextMenu: PropTypes.bool,
selected: PropTypes.bool.isRequired
};
+1
View File
@@ -114,6 +114,7 @@ class SpriteSelectorItem extends React.PureComponent {
return (
<SpriteSelectorItemComponent
costumeURL={this.getCostumeData()}
preventContextMenu={this.dragRecognizer.gestureInProgress()}
onClick={this.handleClick}
onDeleteButtonClick={onDeleteButtonClick ? this.handleDelete : null}
onDuplicateButtonClick={onDuplicateButtonClick ? this.handleDuplicate : null}