Prevent clicks from touches on touchpad
This commit is contained in:
parent
db9ca255fa
commit
1797d7585b
1 changed files with 2 additions and 0 deletions
|
|
@ -217,6 +217,7 @@ function handleTouchend(evt) {
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
evt.preventDefault();
|
||||||
ongoingTouches.splice(idx, 1);
|
ongoingTouches.splice(idx, 1);
|
||||||
touchReleasedCount += 1;
|
touchReleasedCount += 1;
|
||||||
touchLastEnd = evt.timeStamp;
|
touchLastEnd = evt.timeStamp;
|
||||||
|
|
@ -259,6 +260,7 @@ function handleTouchmove(evt) {
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
evt.preventDefault();
|
||||||
if (!touchMoved) {
|
if (!touchMoved) {
|
||||||
var dist = Math.sqrt(Math.pow(touches[i].pageX - ongoingTouches[idx].pageXStart, 2) +
|
var dist = Math.sqrt(Math.pow(touches[i].pageX - ongoingTouches[idx].pageXStart, 2) +
|
||||||
Math.pow(touches[i].pageY - ongoingTouches[idx].pageYStart, 2));
|
Math.pow(touches[i].pageY - ongoingTouches[idx].pageYStart, 2));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue