Do not cancel when panning

This commit is contained in:
Tusooa Zhu 2021-08-02 17:15:53 -04:00
parent a94fb753a1
commit de150c0105
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
6 changed files with 16 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -99,8 +99,10 @@ class PinchZoom extends HTMLElement {
const handled = !(isPan && !this._allowPan());
if (handled) {
this._maybeStopPropagate(event);
if (!isPan) { // only cancel if something was propagated
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
}
}
event.preventDefault();
return true;
},

View file

@ -95,8 +95,10 @@ class PinchZoom extends HTMLElement {
const handled = !(isPan && !this._allowPan());
if (handled) {
this._maybeStopPropagate(event);
if (!isPan) { // only cancel if something was propagated
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
}
}
event.preventDefault();
return true;
},

2
dist/pinch-zoom.js vendored
View file

@ -280,8 +280,10 @@ var PinchZoom = (function () {
const handled = !(isPan && !this._allowPan());
if (handled) {
this._maybeStopPropagate(event);
if (!isPan) { // only cancel if something was propagated
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
}
}
event.preventDefault();
return true;
},

2
dist/pinch-zoom.mjs vendored
View file

@ -95,8 +95,10 @@ class PinchZoom extends HTMLElement {
const handled = !(isPan && !this._allowPan());
if (handled) {
this._maybeStopPropagate(event);
if (!isPan) { // only cancel if something was propagated
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
}
}
event.preventDefault();
return true;
},

View file

@ -125,8 +125,10 @@ export default class PinchZoom extends HTMLElement {
const handled = !(isPan && !this._allowPan());
if (handled) {
this._maybeStopPropagate(event);
if (!isPan) { // only cancel if something was propagated
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
}
}
event.preventDefault();
return true;