swiper icon indicating copy to clipboard operation
swiper copied to clipboard

Double tap to zoom does not reliably work on mobile

Open broox opened this issue 1 year ago • 4 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://swiperjs.com/demos/400-zoom/core

Bug description

In the Zoom module, double tap to zoom does not reliably work in Chrome on my iOS device. It will sometimes zoom if I tap very quickly 3+ times in a row, but it does not work as expected, or like it does in any other browser.

It works as expected on MacOS Chrome, MacOS Safari, and iOS Safari but not iOS Chrome.

Expected Behavior

When the toggle parameter is set to true, double tap should zoom into the coordinates that I tap on in all browsers.

Actual Behavior

Double tapping an image does not zoom in/out of the image on Chrome in iOS.

Swiper version

11.0.6

Platform/Target and Browser Versions

iOS 17.2.1, Chrome 121.0.6167.171

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • [X] I'm willing to open a PR

broox avatar Feb 10 '24 20:02 broox

the bug seems to be that the doubleTap event it not being emitted on mobile chrome. touchEndTime - data.lastClickTime is much greater than 300 despite tapping fast.

my double tap speed on mobile safari (touchEndTime - data.lastClickTime) is registering around ~150ms. my double tap speed on mobile chrome (touchEndTime - data.lastClickTime) is registering around ~500-600ms.

i am tapping my fingers just as quickly in both browsers.

broox avatar Feb 10 '24 20:02 broox

PR incoming.

broox avatar Feb 10 '24 21:02 broox

Any update on this ?

matiasmenker avatar Feb 27 '24 17:02 matiasmenker

Any update here?

Wankishh avatar Jul 16 '24 06:07 Wankishh