From 35d27c6aed17eb337bfdc4a2be731da304ffc370 Mon Sep 17 00:00:00 2001 From: Steven Jones Date: Tue, 8 Aug 2017 19:28:34 +0100 Subject: [PATCH] Disable the default handling of the pinch event when handling it. (#3334) * Disable the default handling of the pinch event when handling it. * Also disable the touch events to prevent double tap zooming. --- lib/timeline/Range.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/timeline/Range.js b/lib/timeline/Range.js index 8d59d9e0..09ed08a4 100644 --- a/lib/timeline/Range.js +++ b/lib/timeline/Range.js @@ -664,6 +664,8 @@ Range.prototype._onTouch = function (event) { // eslint-disable-line no-unused- this.props.touch.center = null; this.scaleOffset = 0; this.deltaDifference = 0; + // Disable the browser default handling of this event. + util.preventDefault(event); }; /** @@ -675,6 +677,9 @@ Range.prototype._onPinch = function (event) { // only allow zooming when configured as zoomable and moveable if (!(this.options.zoomable && this.options.moveable)) return; + // Disable the browser default handling of this event. + util.preventDefault(event); + this.props.touch.allowDragging = false; if (!this.props.touch.center) {