Skip to content

Commit

Permalink
Merge pull request casesandberg#86 from mattbierner/mobile-touchstart…
Browse files Browse the repository at this point in the history
…-fix

Make Hue, Sat, and Alpha components respond to touch start
  • Loading branch information
casesandberg committed Feb 18, 2016
2 parents c20b649 + c0cc94b commit 6587fee
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
4 changes: 3 additions & 1 deletion lib/components/common/Alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ var Alpha = exports.Alpha = function (_ReactCSS$Component) {
_react2.default.createElement('div', { style: this.styles().gradient }),
_react2.default.createElement(
'div',
{ style: this.styles().container, ref: 'container', onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange },
{ style: this.styles().container, ref: 'container', onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange },
_react2.default.createElement(
'div',
{ style: this.styles().pointer, ref: 'pointer' },
Expand Down
4 changes: 3 additions & 1 deletion lib/components/common/Hue.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ var Hue = exports.Hue = function (_ReactCSS$Component) {
{ style: this.styles().hue },
_react2.default.createElement(
'div',
{ style: this.styles().container, ref: 'container', onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange },
{ style: this.styles().container, ref: 'container', onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange },
_react2.default.createElement(
'div',
{ style: this.styles().pointer, ref: 'pointer' },
Expand Down
4 changes: 3 additions & 1 deletion lib/components/common/Saturation.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ var Saturation = exports.Saturation = function (_ReactCSS$Component) {

return _react2.default.createElement(
'div',
{ style: this.styles().color, ref: 'container', onMouseDown: this.handleMouseDown, onTouchMove: this.handleChange },
{ style: this.styles().color, ref: 'container', onMouseDown: this.handleMouseDown,
onTouchMove: this.handleChange,
onTouchStart: this.handleChange },
_react2.default.createElement(
'div',
{ style: this.styles().white },
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ export class Alpha extends ReactCSS.Component {
<Checkboard />
</div>
<div is="gradient" />
<div is="container" ref="container" onMouseDown={ this.handleMouseDown } onTouchMove={ this.handleChange }>
<div is="container" ref="container" onMouseDown={ this.handleMouseDown }
onTouchMove={ this.handleChange }
onTouchStart={ this.handleChange }>
<div is="pointer" ref="pointer">
{ pointer }
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Hue.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export class Hue extends ReactCSS.Component {

return (
<div is="hue">
<div is="container" ref="container" onMouseDown={ this.handleMouseDown } onTouchMove={ this.handleChange }>
<div is="container" ref="container" onMouseDown={ this.handleMouseDown }
onTouchMove={ this.handleChange }
onTouchStart={ this.handleChange }>
<div is="pointer" ref="pointer">
{ pointer }
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/common/Saturation.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export class Saturation extends ReactCSS.Component {
}

return (
<div is="color" ref="container" onMouseDown={ this.handleMouseDown } onTouchMove={ this.handleChange }>
<div is="color" ref="container" onMouseDown={ this.handleMouseDown }
onTouchMove={ this.handleChange }
onTouchStart={ this.handleChange }>
<div is="white">
<div is="black" />
<div is="pointer" ref="pointer">
Expand Down

0 comments on commit 6587fee

Please sign in to comment.