New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 768124 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

event.preventDefault() doesn't seem to work with (touch-generated) pointermove events

Reported by bobbitdi...@gmail.com, Sep 23 2017

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0

Steps to reproduce the problem:
1. add an event handler for onpointermove
2. Do a drag with your finger to trigger a touch-generated pointermove event
3. in the handler, call event.defaultPrevent() and return false (Note that I don't do this in all situations - sometimes I want the native drag behavior)

What is the expected behavior?
This should prevent Chrome from canceling the drag and triggering a pointercancel event.

What went wrong?
a pointercancel event is sent, canceling the drag

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: Version 61.0.3163.100 (Official Build) (64-bit)  Channel: stable
OS Version: Windows 10
Flash Version: Shockwave Flash 27.0 r0

The bug is avoided if I instead listen for touch events rather than pointer events, and call event.preventDefault() on the touchmove event.  It seems that the pointermove event is perhaps "fake" and only the "real" touchmove event will respond to preventDefault()

So, presumably, since the preventDefault() on the pointermove is ignored, Chrome thinks the native drag behavior needs to run, and thus sends the pointercancel.  Note that if I don't call preventDefault on the touchmove when listening for touch events, I get a similar unwanted touchcancel.

Finally, I'm aware of the CSS property `touch-action:none' but I don't want to use it hare, as that blocks native touch scroll ALL the time.  In my code, I call preventDefault() only in some situations.
 
Cc: brajkumar@chromium.org
Components: Blink
Labels: Needs-Feedback Needs-Triage-M61
Reporter@ Thanks for posting the issue, could you please provide sample test case or jsfiddle to check this issue from chrome testing team.

Thanks!
Cc: dtapu...@chromium.org mustaq@chromium.org
Components: -Blink Blink>Input
Owner: nzolghadr@chromium.org
Status: Assigned (was: Unconfirmed)
Beside the repro page, can you also confirm the steps. I mean do you long press to drag with touch? Because drag will start if you actually don't move your finger beyond the slop region for a little while.
Status: WontFix (was: Assigned)
We need more context about this issue. Feel free to open a new issue you found a sample and the steps to reproduce the problem.

Sign in to add a comment