Check whether we swiped only for mouse pointer

This commit is contained in:
Tusooa Zhu 2021-08-02 22:08:04 -04:00
parent 6980e4ddf1
commit a485ebc2bb
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224

View file

@ -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
}
}