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

fix: zoom does not work when pinching on mobile #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

suke
Copy link

@suke suke commented Aug 10, 2024

This PR addresses: #487

I have output the log of touch events during a pinch on mobile, and it seems to be behaving as follows:

  1. The touch event event.touches.length === 2 is fired only once at the pinch start
  2. Two touch events are fired at the pinch start: event.touches.length === 1 and event.touches.length === 2

In case 1, the pinch works correctly. However, in case 2, the quick, consecutive tap events are interpreted as a double-tap.
To address case 2, I have changed it so that only single-finger touches are treated as a double-tap.

github-merge-queue bot pushed a commit to powerhome/playbook that referenced this pull request Oct 22, 2024
**What does this PR do?**
Upgrade react-zoom-pan-pinch from 2.6.1 to 3.6.0

Fix "pinch" bug on mobile and tablet by avoiding [3.6.1
version](https://github.com/BetterTyped/react-zoom-pan-pinch/releases/tag/v3.6.1)
which has a bug with "double click" and "two fingers" on zoom.
See discussion in [GitHub
issues](BetterTyped/react-zoom-pan-pinch#487).
Someone made a
[PR](BetterTyped/react-zoom-pan-pinch#499) which
hasn't been merged yet, so this might be fixed in later versions.

**How to test?**
Go through the Lightbox kit for any regressions


#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants