loleaflet/src/map/handler/Map.TouchGesture.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
New commits: commit 49447ec08c5d3904028e77a0f8f596571ab8a05b Author: mert <mert.tu...@collabora.com> AuthorDate: Wed Sep 16 17:31:46 2020 +0300 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Sep 21 20:29:08 2020 +0200 Fix pinch gesture causes hammer to stuck on Mobile Change-Id: If0ae311346a1111e9c9935ebacde3bc5ea874833 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103057 diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 677d15dec..cd22175a5 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({ var tripleTap = new Hammer.Tap({event: 'tripletap', taps: 3, posThreshold: posThreshold }); this._hammer.add(tripleTap); tripleTap.recognizeWith([doubleTap, singleTap]); - + var hammer = this._hammer; if (L.Browser.touch) { - L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchend touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchend', function(e) { + // sometimes inputs get stuck in hammer and further events get mixed with the old ones + // this causes to a failure to use all the gestures properly. + // This is a workaround until it is fixed by hammer.js + if (hammer.input) { + if (hammer.input.store) { + hammer.input.store = []; + } + } + L.DomEvent.preventDefault(e); + }); } if (Hammer.prefixed(window, 'PointerEvent') !== undefined) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits