瀏覽代碼

Check whether we swiped only for mouse pointer

Tusooa Zhu 3 年之前
父節點
當前提交
a485ebc2bb
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/services/gesture_service/gesture_service.js

+ 5 - 1
src/services/gesture_service/gesture_service.js

@@ -190,7 +190,11 @@ class SwipeAndClickGesture {
       this.swipeEndCallback(sign)
     }
     this._reset()
-    if (swiped) {
+    // Only a mouse will fire click event when
+    // the end point is far from the starting point
+    // so for other kinds of pointers do not check
+    // whether we have swiped
+    if (swiped && event.pointerType === 'mouse') {
       this._preventNextClick = true
     }
   }