Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
6 tasks done
broox opened this issue Feb 10, 2024 · 5 comments · May be fixed by #7310
Open
6 tasks done

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

broox opened this issue Feb 10, 2024 · 5 comments · May be fixed by #7310

Comments

@broox
Copy link
Contributor

broox commented Feb 10, 2024

Check that this is really a bug

  • 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

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

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@broox
Copy link
Contributor Author

broox commented Feb 10, 2024

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
Copy link
Contributor Author

broox commented Feb 10, 2024

PR incoming.

@matiasmenker
Copy link

Any update on this ?

@Wankishh
Copy link

Any update here?

@broox
Copy link
Contributor Author

broox commented Dec 16, 2024

FWIW - The toggle option seems to work with the version of swiper that I'm running now 11.1.14 with mobile chrome (131.0.6778.134) and safari (18.2on iOS. Can anyone else confirm whether this is an issue for them still?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants