Touchmove events do not fire when target is removed
Reported by
chris.ma...@gmail.com,
Nov 17 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36 Steps to reproduce the problem: 1. https://jsfiddle.net/6mrpy733/9/ 2. Open the console to see when the touchmove handler is hit. 3. Drag the red circle and note that no touchmove events are received as soon as the element is removed. What is the expected behavior? I would expect the events to continue to bubble to the parent. Also, this is how it works with mouse events. What went wrong? No touchmove events are sent. Did this work before? No Does this work in other browsers? No Reproduced in Firefox as well. Chrome version: 54.0.2840.100 Channel: stable OS Version: Flash Version: Shockwave Flash 23.0 r0 When an item is remove from the DOM that was the target of an touchstart, no more touchmove events are fired until the element is re-added.
,
Nov 17 2016
M54 is not a realistic milestone for a fix, but team is on the process of triaging and will add appropriate Milestone.
,
Nov 18 2016
Unable to reproduce the issue on Windows-10 (touch screen) using chrome stable version 54.0.2840.99 and canary 56.0.2922.0 with the steps mentioned above. Please find the attached screen-cast for reference. Could some one from MTV team please check on Linux touch screen if available. Thanks..
,
Nov 18 2016
Based on the attached video you did reproduce the issue. The red circle was initially hidden for 1 second, and no touchmove events were received during that time. After the red circle was added back in you started receiving events again. Try increasing the delay on line 53 to make it more noticeable.
,
Nov 18 2016
The problem you are experiencing is the fact that touch events are implicitly captured so they are sent to the EventTarget which is the child dom node and the events don't bubble up when it is removed because the target is disconnected from the DOM. This creates a problem because you are using jquery and it uses event delegation so the touchmoves don't fire on the DOM you don't see them on your bound jquery target. However if you don't use event delegation and add an event listener directly they do work. Here is an example working: https://jsfiddle.net/f3gr417m/2/
,
Nov 18 2016
I just tried it without jQuery and I got the same result: https://jsfiddle.net/6mrpy733/11/
,
Jan 5 2017
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by chris.ma...@gmail.com
, Nov 17 2016