From d1c5ccfdadbc5667e71770c68e617b2e3ad48b12 Mon Sep 17 00:00:00 2001 From: glo5363 Date: Fri, 3 Feb 2023 13:31:49 +0530 Subject: [PATCH] Multiple errors are displayed in Console when switching images in mobile view-addevent passive listener fixes for touchstart mobile event --- lib/web/fotorama/fotorama.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/web/fotorama/fotorama.js b/lib/web/fotorama/fotorama.js index 077a81b096685..a60999ef76474 100644 --- a/lib/web/fotorama/fotorama.js +++ b/lib/web/fotorama/fotorama.js @@ -1140,7 +1140,7 @@ fotoramaVersion = '4.6.4'; function addEvent(el, e, fn, bool) { if (!e) return; - el.addEventListener ? el.addEventListener(e, fn, {passive: true}) : el.attachEvent('on' + e, fn); + el.addEventListener ? el.addEventListener(e, fn, !!bool) : el.attachEvent('on' + e, fn); } /** @@ -1519,7 +1519,7 @@ fotoramaVersion = '4.6.4'; addEvent(el, 'touchmove', onMove); addEvent(el, 'touchend', onEnd); - addEvent(document, 'touchstart', onOtherStart); + addEvent(document, 'touchstart', onOtherStart, true); addEvent(document, 'touchend', onOtherEnd); addEvent(document, 'touchcancel', onOtherEnd);