File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -249,30 +249,21 @@ class ScrollView extends Component {
249
249
this . scroller . doTouchMove ( touches , timeStamp , scale )
250
250
}
251
251
252
- doTouchEnd ( touches , timeStamp ) {
253
- if ( this . needsCaptureClick ( ) ) {
254
- this . setupCaptureClickTask . perform ( ) ;
252
+ doTouchEnd ( touches , timeStamp , event ) {
253
+ let preventClick = this . needsPreventClick ( )
254
+
255
+ if ( preventClick ) {
256
+ event . preventDefault ( ) ;
255
257
}
258
+
256
259
this . scroller . doTouchEnd ( timeStamp ) ;
257
- }
258
260
259
- @task
260
- setupCaptureClickTask = function * ( ) {
261
- try {
262
- let { scrollViewElement } = this ;
263
- let captureClick = ( e ) => {
264
- e . stopPropagation ( ) ; // Stop the click from being propagated.
265
- scrollViewElement . removeEventListener ( 'click' , captureClick , true ) ; // cleanup
266
- }
267
- scrollViewElement . addEventListener ( 'click' , captureClick , true ) ;
268
- yield timeout ( 0 ) ;
269
- scrollViewElement . removeEventListener ( 'click' , captureClick , true ) ;
270
- } finally {
261
+ if ( preventClick ) {
271
262
this . _decelerationVelocityY = null ;
272
263
}
273
264
}
274
265
275
- needsCaptureClick ( ) {
266
+ needsPreventClick ( ) {
276
267
// There are two cases where we want to prevent the click that normally follows a mouseup/touchend.
277
268
//
278
269
// 1) when the user is just finishing a purposeful scroll (i.e. dragging scroll view beyond a threshold)
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export default class ZyngaScrollerVerticalRecognizer extends Hammer.Pan {
47
47
if ( inputData . isFirst ) {
48
48
this . options . scrollComponent . doTouchStart ( inputData . pointers , inputData . timeStamp ) ;
49
49
} else if ( inputData . isFinal ) {
50
- this . options . scrollComponent . doTouchEnd ( inputData . pointers , inputData . timeStamp ) ;
50
+ this . options . scrollComponent . doTouchEnd ( inputData . pointers , inputData . timeStamp , inputData . srcEvent ) ;
51
51
} else {
52
52
this . options . scrollComponent . doTouchMove ( inputData . pointers , inputData . timeStamp , inputData . scale ) ;
53
53
}
You can’t perform that action at this time.
0 commit comments