-
Notifications
You must be signed in to change notification settings - Fork 141
Zoom issue with touchstarted event #72
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
Comments
To clarify... the issue is with the two initial touches that should start the zoom. When the zoom start event is missed, moving one's fingers apart and together doesn't do anything. |
mbostock
added a commit
that referenced
this issue
Nov 28, 2016
Please test and review #74. If it works, I will merge and push a patch release. Thank you! |
Tested #74 on iPhone 7, both the mobile Safari and Chrome browsers, and the fix worked perfectly! |
Great. Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On iPhone 7, iOS 10, with both the mobile Chrome and Safari browsers, the zoom functionality will fail if the two pinch-zoom touches happen very close to the same time. This creates a usability issue, as normally when users pinch-zoom, their fingers do in fact hit the screen at nearly the same time.
Not all devices are affected. I was able to test a Windows 7 touch device, and I was not able to get it to exhibit the same behaviour.
On the iPhone, the issue is with the
changedTouches
andtouches
collections on thetouchstarted
event. When the issue occurs on the iPhone:changedTouches
touches
.(On the Windows device, behaviour differs in that the first event has only one element in
touches
.)With the first event having two elements in
touches
on the iPhone, the zoom fails due to the if statement here (added in #17), astouches
is of length 2 andchangedTouches
is of length 1, preventing the gesture start from being called:I tested commenting out this if condition, and confirmed that the iPhone started working again as expected. However, I don't know if removing this will cause any other issues. (I did test the double-tap to zoom with this line commented out, and it continued to work fine.)
Note that this may apply to other devices and versions as well, but I'm limited in what I can test. I did test a Windows 7 touch computer, and was not able to reproduce the issue (the first received touchstarted event always had a single touch value).
The text was updated successfully, but these errors were encountered: