Skip to content

Commit 623b368

Browse files
committed
Build bundle including the new touch changes with webpack.
1 parent da09a0f commit 623b368

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

dist/react-selectable.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,17 @@ return /******/ (function(modules) { // webpackBootstrap
125125
_this.state = {
126126
isBoxSelecting: false,
127127
boxWidth: 0,
128-
boxHeight: 0,
129-
mouseDownStarted: false,
130-
mouseMoveStarted: false,
131-
mouseUpStarted: false
128+
boxHeight: 0
132129
};
133130

134131
_this._mouseDownData = null;
135132
_this._registry = [];
136133

134+
// Used to prevent actions from firing twice on devices that are both click and touch enabled
135+
_this._mouseDownStarted = false;
136+
_this._mouseMoveStarted = false;
137+
_this._mouseUpStarted = false;
138+
137139
_this._openSelector = _this._openSelector.bind(_this);
138140
_this._mouseDown = _this._mouseDown.bind(_this);
139141
_this._mouseUp = _this._mouseUp.bind(_this);
@@ -193,24 +195,24 @@ return /******/ (function(modules) { // webpackBootstrap
193195
}, {
194196
key: '_openSelector',
195197
value: function _openSelector(e) {
196-
if (this.state.mouseMoveStarted) return;
197-
this.state.mouseMoveStarted = true;
198+
var _this2 = this;
199+
200+
if (this._mouseMoveStarted) return;
201+
this._mouseMoveStarted = true;
198202

199203
e = this._desktopEventCoords(e);
200204

201205
var w = Math.abs(this._mouseDownData.initialW - e.pageX);
202206
var h = Math.abs(this._mouseDownData.initialH - e.pageY);
203207

204-
var component = this;
205-
206208
this.setState({
207209
isBoxSelecting: true,
208210
boxWidth: w,
209211
boxHeight: h,
210212
boxLeft: Math.min(e.pageX, this._mouseDownData.initialW),
211213
boxTop: Math.min(e.pageY, this._mouseDownData.initialH)
212214
}, function () {
213-
component.state.mouseMoveStarted = false;
215+
_this2._mouseMoveStarted = false;
214216
});
215217
}
216218

@@ -222,9 +224,9 @@ return /******/ (function(modules) { // webpackBootstrap
222224
}, {
223225
key: '_mouseDown',
224226
value: function _mouseDown(e) {
225-
if (this.state.mouseDownStarted) return;
226-
this.state.mouseDownStarted = true;
227-
this.state.mouseUpStarted = false;
227+
if (this._mouseDownStarted) return;
228+
this._mouseDownStarted = true;
229+
this._mouseUpStarted = false;
228230

229231
e = this._desktopEventCoords(e);
230232

@@ -274,9 +276,9 @@ return /******/ (function(modules) { // webpackBootstrap
274276
}, {
275277
key: '_mouseUp',
276278
value: function _mouseUp(e) {
277-
if (this.state.mouseUpStarted) return;
278-
this.state.mouseUpStarted = true;
279-
this.state.mouseDownStarted = false;
279+
if (this._mouseUpStarted) return;
280+
this._mouseUpStarted = true;
281+
this._mouseDownStarted = false;
280282

281283
_reactDom2.default.findDOMNode(this).removeEventListener('mousemove', this._openSelector);
282284
_reactDom2.default.findDOMNode(this).removeEventListener('mouseup', this._mouseUp);

0 commit comments

Comments
 (0)