Skip to content

Commit

Permalink
Multiple errors are displayed in Console when switching images in mob…
Browse files Browse the repository at this point in the history
…ile view-addevent passive listener fixes for touchstart mobile event
  • Loading branch information
glo05363 committed Feb 3, 2023
1 parent 8c1744d commit d1c5ccf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/web/fotorama/fotorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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);

Expand Down

1 comment on commit d1c5ccf

@AdrianNWT
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: This introduces a bug where you can't swipe the images in the fotorama image gallery on the product page on mobile in Magento 2.4.6.
It can also be seen in chrome's responsive mode.

Please sign in to comment.