From 2bae8ed71ac34e5f7ea4b8462e0772552cb2e13c Mon Sep 17 00:00:00 2001 From: Paul Kaplan Date: Fri, 9 Feb 2018 09:32:00 -0500 Subject: [PATCH] Mark all clickable images as not draggable. When using images as clickable elements (within buttons or alone) you need to mark them as not draggable. They are draggable by default and starting a drag prevents the onClick from being handled, messing up the clickable behavior. --- src/components/color-button/color-button.jsx | 2 ++ src/components/color-picker/color-picker.jsx | 10 ++++++++-- src/components/dropdown/dropdown.jsx | 1 + .../labeled-icon-button/labeled-icon-button.jsx | 1 + src/components/mode-tools/mode-tools.jsx | 2 ++ src/components/paint-editor/paint-editor.jsx | 9 +++++++++ src/components/tool-select-base/tool-select-base.jsx | 1 + 7 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/color-button/color-button.jsx b/src/components/color-button/color-button.jsx index 51b0c81d..af636369 100644 --- a/src/components/color-button/color-button.jsx +++ b/src/components/color-button/color-button.jsx @@ -29,11 +29,13 @@ const ColorButtonComponent = props => ( {props.color === null ? ( ) : ((props.color === MIXED ? ( ) : null))} diff --git a/src/components/color-picker/color-picker.jsx b/src/components/color-picker/color-picker.jsx index c732eb0c..e3239a54 100644 --- a/src/components/color-picker/color-picker.jsx +++ b/src/components/color-picker/color-picker.jsx @@ -114,7 +114,10 @@ class ColorPickerComponent extends React.Component { })} onClick={this.props.onTransparent} > - +
@@ -125,7 +128,10 @@ class ColorPickerComponent extends React.Component { })} onClick={this.props.onActivateEyeDropper} > - +
diff --git a/src/components/dropdown/dropdown.jsx b/src/components/dropdown/dropdown.jsx index 31d2ba6d..497d4e89 100644 --- a/src/components/dropdown/dropdown.jsx +++ b/src/components/dropdown/dropdown.jsx @@ -50,6 +50,7 @@ class Dropdown extends React.Component { className={classNames(styles.dropdownIcon, { [styles.modCaretUp]: this.state.isOpen })} + draggable={false} src={dropdownIcon} /> diff --git a/src/components/labeled-icon-button/labeled-icon-button.jsx b/src/components/labeled-icon-button/labeled-icon-button.jsx index 45555f36..332f0dca 100644 --- a/src/components/labeled-icon-button/labeled-icon-button.jsx +++ b/src/components/labeled-icon-button/labeled-icon-button.jsx @@ -26,6 +26,7 @@ const LabeledIconButton = ({ {imgAlt} {title} diff --git a/src/components/mode-tools/mode-tools.jsx b/src/components/mode-tools/mode-tools.jsx index e2b9b3ec..fd788ba3 100644 --- a/src/components/mode-tools/mode-tools.jsx +++ b/src/components/mode-tools/mode-tools.jsx @@ -80,6 +80,7 @@ const ModeToolsComponent = props => { {props.intl.formatMessage(messages.brushSize)} @@ -101,6 +102,7 @@ const ModeToolsComponent = props => { {props.intl.formatMessage(messages.eraserSize)} diff --git a/src/components/paint-editor/paint-editor.jsx b/src/components/paint-editor/paint-editor.jsx index a39016b9..413a2449 100644 --- a/src/components/paint-editor/paint-editor.jsx +++ b/src/components/paint-editor/paint-editor.jsx @@ -160,6 +160,7 @@ const PaintEditorComponent = props => { {props.intl.formatMessage(messages.undo)} @@ -178,6 +179,7 @@ const PaintEditorComponent = props => { {props.intl.formatMessage(messages.redo)} @@ -258,6 +260,7 @@ const PaintEditorComponent = props => { > {props.intl.formatMessage(messages.front)} @@ -271,6 +274,7 @@ const PaintEditorComponent = props => { > {props.intl.formatMessage(messages.back)} @@ -283,6 +287,7 @@ const PaintEditorComponent = props => { > {'Rotation Point'} @@ -398,6 +403,7 @@ const PaintEditorComponent = props => {
@@ -415,6 +421,7 @@ const PaintEditorComponent = props => { Zoom Out @@ -425,6 +432,7 @@ const PaintEditorComponent = props => { Zoom Reset @@ -435,6 +443,7 @@ const PaintEditorComponent = props => { Zoom In diff --git a/src/components/tool-select-base/tool-select-base.jsx b/src/components/tool-select-base/tool-select-base.jsx index 1c27268e..846b4dce 100644 --- a/src/components/tool-select-base/tool-select-base.jsx +++ b/src/components/tool-select-base/tool-select-base.jsx @@ -24,6 +24,7 @@ const ToolSelectComponent = props => ( id: props.imgDescriptor.id })} className={styles.toolSelectIcon} + draggable={false} src={props.imgSrc} />