New issue
Advanced search Search tips

Issue 796576 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 625198



Sign in to add a comment

Touch adjustment for double tap

Project Member Reported by mustaq@chromium.org, Dec 20 2017

Issue description

The targets for the two touchstart events that constitute a double tap could be off significantly from each other when the double tap occurs around the boundary of two elements.  This is because the allowed slop seems to be upto 100px (at least in some platforms):
https://cs.chromium.org/chromium/src/ui/events/gesture_detection/gesture_detector.cc?rcl=1b43007318e334b5f16e910309b28f85f0d7d3b4&l=43

As of today, the touch events are not touch adjusted, so the two corresponding touchstart events seen by the JS is within 100px of each other.  This seems bad for a div that wants to prevent double taps but not single taps: the page will have to add extra listeners within 100px of the div!

Hopefully this is not a major issue since we haven't seen any bugs about it I believe.

What worries me a bit more is that with our new touch adjustment plan (adjustments done in touchstarts), the two targeted divs could be even further apart: 100px plus twice the touch-adjustment-offset in the worst case.

We need to consider reusing the touch adjustment result from the first touchstart for repeated taps:
https://cs.chromium.org/chromium/src/ui/events/gesture_detection/gesture_detector.cc?rcl=1b43007318e334b5f16e910309b28f85f0d7d3b4&l=498

 

Comment 1 by mustaq@chromium.org, Dec 20 2017

Blockedon: 625198

Comment 2 by eirage@chromium.org, Dec 20 2017

Double tap will send a dblclick event, so page may handle double tap on dblclick. 

However, When two tap within a 100px slop, we are firing first "click" event to target A, second "click" event to target B, and a "dblclick" event to target B. I think it's weird that when two click is in different target, we still fire "dblclick" event.

Comment 3 by mustaq@chromium.org, Dec 20 2017

The 100px offset is quite annoying in Android, btw, as you showed me through:
  https://rbyers.github.io/eventTest.html
We shouldn't increase it further.

Another issue: if I am reading the spec correctly, the second tap should generate 
  mousedown,mouseup,dblclick
as opposed to what we do now (mousedown,mouseup,click,dblclick).  Firefox does the same unfortunately.

Sign in to add a comment