@@ -125,15 +125,17 @@ return /******/ (function(modules) { // webpackBootstrap
125
125
_this . state = {
126
126
isBoxSelecting : false ,
127
127
boxWidth : 0 ,
128
- boxHeight : 0 ,
129
- mouseDownStarted : false ,
130
- mouseMoveStarted : false ,
131
- mouseUpStarted : false
128
+ boxHeight : 0
132
129
} ;
133
130
134
131
_this . _mouseDownData = null ;
135
132
_this . _registry = [ ] ;
136
133
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
+
137
139
_this . _openSelector = _this . _openSelector . bind ( _this ) ;
138
140
_this . _mouseDown = _this . _mouseDown . bind ( _this ) ;
139
141
_this . _mouseUp = _this . _mouseUp . bind ( _this ) ;
@@ -193,24 +195,24 @@ return /******/ (function(modules) { // webpackBootstrap
193
195
} , {
194
196
key : '_openSelector' ,
195
197
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 ;
198
202
199
203
e = this . _desktopEventCoords ( e ) ;
200
204
201
205
var w = Math . abs ( this . _mouseDownData . initialW - e . pageX ) ;
202
206
var h = Math . abs ( this . _mouseDownData . initialH - e . pageY ) ;
203
207
204
- var component = this ;
205
-
206
208
this . setState ( {
207
209
isBoxSelecting : true ,
208
210
boxWidth : w ,
209
211
boxHeight : h ,
210
212
boxLeft : Math . min ( e . pageX , this . _mouseDownData . initialW ) ,
211
213
boxTop : Math . min ( e . pageY , this . _mouseDownData . initialH )
212
214
} , function ( ) {
213
- component . state . mouseMoveStarted = false ;
215
+ _this2 . _mouseMoveStarted = false ;
214
216
} ) ;
215
217
}
216
218
@@ -222,9 +224,9 @@ return /******/ (function(modules) { // webpackBootstrap
222
224
} , {
223
225
key : '_mouseDown' ,
224
226
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 ;
228
230
229
231
e = this . _desktopEventCoords ( e ) ;
230
232
@@ -274,9 +276,9 @@ return /******/ (function(modules) { // webpackBootstrap
274
276
} , {
275
277
key : '_mouseUp' ,
276
278
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 ;
280
282
281
283
_reactDom2 . default . findDOMNode ( this ) . removeEventListener ( 'mousemove' , this . _openSelector ) ;
282
284
_reactDom2 . default . findDOMNode ( this ) . removeEventListener ( 'mouseup' , this . _mouseUp ) ;
0 commit comments