nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.89k stars 9.74k forks source link

Double tap to zoom does not reliably work on mobile #7309

Open broox opened 9 months ago

broox commented 9 months ago

Check that this is really a bug

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

Would you like to open a PR for this bug?

broox commented 9 months ago

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 commented 9 months ago

PR incoming.

matiasmenker commented 8 months ago

Any update on this ?

Wankishh commented 3 months ago

Any update here?