event.preventDefault() doesn't seem to work with (touch-generated) pointermove events
Reported by
bobbitdi...@gmail.com,
Sep 23 2017
|
|||
Issue descriptionUserAgent: 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.
,
Sep 25 2017
,
Sep 27 2017
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.
,
Oct 19 2017
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 |
|||
Comment 1 by brajkumar@chromium.org
, Sep 25 2017Components: Blink
Labels: Needs-Feedback Needs-Triage-M61