Do not cancel when panning
This commit is contained in:
parent
a94fb753a1
commit
de150c0105
6 changed files with 16 additions and 6 deletions
2
dist/pinch-zoom-min.js
vendored
2
dist/pinch-zoom-min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/pinch-zoom.cjs.js
vendored
4
dist/pinch-zoom.cjs.js
vendored
|
@ -99,7 +99,9 @@ class PinchZoom extends HTMLElement {
|
|||
const handled = !(isPan && !this._allowPan());
|
||||
if (handled) {
|
||||
this._maybeStopPropagate(event);
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
if (!isPan) { // only cancel if something was propagated
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
4
dist/pinch-zoom.es.js
vendored
4
dist/pinch-zoom.es.js
vendored
|
@ -95,7 +95,9 @@ class PinchZoom extends HTMLElement {
|
|||
const handled = !(isPan && !this._allowPan());
|
||||
if (handled) {
|
||||
this._maybeStopPropagate(event);
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
if (!isPan) { // only cancel if something was propagated
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
4
dist/pinch-zoom.js
vendored
4
dist/pinch-zoom.js
vendored
|
@ -280,7 +280,9 @@ var PinchZoom = (function () {
|
|||
const handled = !(isPan && !this._allowPan());
|
||||
if (handled) {
|
||||
this._maybeStopPropagate(event);
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
if (!isPan) { // only cancel if something was propagated
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
4
dist/pinch-zoom.mjs
vendored
4
dist/pinch-zoom.mjs
vendored
|
@ -95,7 +95,9 @@ class PinchZoom extends HTMLElement {
|
|||
const handled = !(isPan && !this._allowPan());
|
||||
if (handled) {
|
||||
this._maybeStopPropagate(event);
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
if (!isPan) { // only cancel if something was propagated
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
}
|
||||
}
|
||||
event.preventDefault();
|
||||
return true;
|
||||
|
|
|
@ -125,7 +125,9 @@ export default class PinchZoom extends HTMLElement {
|
|||
const handled = !(isPan && !this._allowPan());
|
||||
if (handled) {
|
||||
this._maybeStopPropagate(event);
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
if (!isPan) { // only cancel if something was propagated
|
||||
this._maybeEmitCancel([pointer, ...pointerTracker.currentPointers]);
|
||||
}
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue