Skip to content

Conversation

testower
Copy link
Contributor

@testower testower commented Feb 5, 2019

Proposal to fix issue #124

I guess PR #125 would be an alternative fix, and would certainly solve our problem too, but the maintainers don't seem keen on merging it?

@testower testower changed the title Return if there is no active gesture FIX #124 - Return if there is no active gesture Feb 5, 2019
@testower
Copy link
Contributor Author

testower commented Jun 28, 2019

Is there any hope of merging this or #125 @mbostock ?

Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this looks good. I’ll try to get out it soon.

robinhouston added a commit to kiln/d3-zoom that referenced this pull request Jul 16, 2019
It seems that the behaviour of Chrome on Android differs from the
behaviour of Safari on iOS in the following respect: when a multitouch
event is initiated by touching two or more fingers to the screen
near-simultaneously, iOS Safari will fire a single touchstart event
that includes all the touches (as both event.touches and event.changedTouches)
whereas Android Chrome will fire a sequence of touchstart events:

- one with touches.length == 1 and changedTouches.length == 1
- followed by one with touches.length == 2 and changedTouches.length == 1

In other words, the behaviour on Android Chrome when the screen is
touched with two fingers simultaneously is the same as the behaviour
on iOS Safari when you touch it first with one finger and then a second.

The change in PR d3#169 makes it possible to ignore single-touch gestures
on iOS Safari, but this fails on Android Chrome because the first touch
is never recorded. When the second touch is processed, the changedTouches
array contains only the second touch.

This commit changes the behaviour of the touchstarted handler to consider
all the touches in the event, rather than just the new touches.
@mbostock
Copy link
Member

This should go out together with #176.

mbostock pushed a commit that referenced this pull request Aug 5, 2019
It seems that the behaviour of Chrome on Android differs from the
behaviour of Safari on iOS in the following respect: when a multitouch
event is initiated by touching two or more fingers to the screen
near-simultaneously, iOS Safari will fire a single touchstart event
that includes all the touches (as both event.touches and event.changedTouches)
whereas Android Chrome will fire a sequence of touchstart events:

- one with touches.length == 1 and changedTouches.length == 1
- followed by one with touches.length == 2 and changedTouches.length == 1

In other words, the behaviour on Android Chrome when the screen is
touched with two fingers simultaneously is the same as the behaviour
on iOS Safari when you touch it first with one finger and then a second.

The change in PR #169 makes it possible to ignore single-touch gestures
on iOS Safari, but this fails on Android Chrome because the first touch
is never recorded. When the second touch is processed, the changedTouches
array contains only the second touch.

This commit changes the behaviour of the touchstarted handler to consider
all the touches in the event, rather than just the new touches.
@mbostock
Copy link
Member

mbostock commented Aug 5, 2019

Merged as a84dba2.

@mbostock mbostock closed this Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants