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

dbltap doesn't work on iPad #206

Closed
Fil opened this issue May 22, 2020 · 6 comments
Closed

dbltap doesn't work on iPad #206

Fil opened this issue May 22, 2020 · 6 comments
Assignees

Comments

@Fil
Copy link
Member

Fil commented May 22, 2020

Testing d3-zoom (e.g. https://observablehq.com/@d3/zoom-canvas-rescaled or any other) on an iPad, a dbltap doesn't trigger x2 zooming—but a triple tap does. With the pencil it's never triggered, no matter how many "taps".

(On the iPhone dbltap works. )

I'm investigating but it would be nice if someone could confirm or infirm this observation.

@Fil Fil self-assigned this May 22, 2020
@Fil
Copy link
Member Author

Fil commented May 22, 2020

  • I see the same problem with FF, Chrome, and Safari
  • the issue of dbltap being inhibited is present with [email protected] but not @1.3.0 (diff)
  • adding .style("touch-action", null); makes dbltap operate again
  • no versions seem to work with pencil dbltap
  • David B. remarks "No issue on BrowserStack's iPad"

@mbostock
Copy link
Member

I don’t remember what the point of touch-action: none was…

@Fil
Copy link
Member Author

Fil commented May 23, 2020

It looks like the iPad really wants to deduplicate touchstart: on https://observablehq.com/d/a6c2cfc4e1fad9ea as soon as a touchstart listener is registered, a double-tap creates only one event of each kind (touchstart, mousedown, mousemove, mouseup, click and so on).

A solution might be to switch to Pointer Events (https://observablehq.com/@fil/pointer-events), where this doesn't happen. But it looks to me like an iOS (iPad 13.4.1) bug (?).

@Fil
Copy link
Member Author

Fil commented May 23, 2020

Re: pencil dbl-tap, the issue is that a touchmove event is received, in which we reset g.taps to 0.

This issue can be fixed by removing:

      if (touchstarting) touchstarting = clearTimeout(touchstarting);
      g.taps = 0;

@Fil Fil mentioned this issue May 25, 2020
5 tasks
@Fil
Copy link
Member Author

Fil commented Jul 10, 2020

Another comment on touch-action… #188 (review)

@Fil
Copy link
Member Author

Fil commented Jul 13, 2020

After some digging it appears that touch-action: none was added at about the same time as this conversation happened. In that case it might be related with enabling something (?) on Surface tablets.

@Fil Fil mentioned this issue Jul 15, 2020
Fil added a commit that referenced this issue Jul 24, 2020
@Fil Fil closed this as completed in 3318746 Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants