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

Handle orphaned gestures. #60

Closed
mbostock opened this issue Sep 26, 2016 · 1 comment
Closed

Handle orphaned gestures. #60

mbostock opened this issue Sep 26, 2016 · 1 comment

Comments

@mbostock
Copy link
Member

The equivalent of d3/d3-brush#18, but for d3-zoom. If the browser fails to deliver a mouseup (or touchend or touchcancel) event, the active gesture can get orphaned, in which case no new gestures can start or end.

bhousel added a commit to openstreetmap/iD that referenced this issue Dec 6, 2016
(closes #2151), (see also d3/d3-zoom#60, d3/d3-brush#18)

Intercept `mousedown` and check if there is an orphaned zoom gesture.
This can happen if a previous `mousedown` occurred without a `mouseup`.
If we detect this, dispatch `mouseup` to complete the orphaned gesture,
so that d3-zoom won't stop propagation of new `mousedown` events.
@MarkusMannheim
Copy link

MarkusMannheim commented Jan 18, 2018

May I get an update on this? This affects all of my scripts that use d3.zoom() when accessed via mobiles/touchscreens. When the user pinches to zoom in/zoom out, and then tries to pan by dragging with a single touch, the program behaves as though two fingers are still touching the screen - i.e. it doesn't fire a touchend/touchcancel event, or enough touchend/touchcancel events.

The bug occurs in iOS and Android, across all browsers I tried (though I wasn't exhaustive).

Is there a workaround?

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