-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DragEnd event not firing consistently on Android Chrome - Pixel Oreo? #114
Comments
Thanks for the detailed report. I'm currently in babymoon and will be back in 2-3 weeks. I don't have access to a Google Pixel but I will try to support you as much as I can to solve this issue. To debug this further please include the unminified polyfill ( |
Conrats! :) Please find below the console output when the dropend event fails to fire:
Post failure, the next time I touch the screen it seems to complete the operation...
|
Just to clarify, does the line
occur twice in a row or just once? |
I'm only seeing it occur once. |
When the So the initial touch causes just these logs
and only the second touch interaction will start the drag and drop
Is that correct? |
The drag image is displayed and can be moved around. It can even be dropped in an active drop zone. However, none of the events are firing/being logged. Here's a further example of how I'm recreating the issue using my CodePen example - I'm using my Google Pixel (Android version: 8.0.0, Chrome version is now 62.0.3202.84) connected to Google Canary Dev Tools. All interactions are being made on the device itself.
This issue is intermittent, but does occur fairly frequently. One thing I have noticed, which may or may not be relevant - it seems to occur more when I deliberately hold the drag element before dragging (I have holdToDrag set at 500). |
Thats detailed! Thanks 👍 Disabling holdToDrag does not change anything I presume? |
Apologies, I didn't think this made much difference but I've just double checked it and disabling the "holdToDrag" does make it work. Obviously in order to work smoothly on mobile the holdToDrag is pretty essential. My example was built with the view that you can swipe and scroll the viewport without accidentally dragging any elements. |
Cool, this will make it easier to track it down and improve on the "holdToDrag" code. An alternative to You can look up the demo for an example of drag handle implementation: But nonetheless |
I enhanced logging and applied a small fix regarding event listeners used for You can grab the files from here to test: |
Hi, Quick update.. I've switched my codepen to point at the branch assets (this appears to be correct):
But the following exception is now thrown...
Did I miss something in swapping to this branch? |
Sure 👍 Some quick, initial testing sees the same issue occurring - still intermittently
Console listed below:
Thanks. |
Frankly.. I'm a bit lost - can you activate the timestamps in the chrome console and repeat the procedure? |
Hi, I've switched on timestamps and run the test again - same results. I couldn't copy timestamps to clipboard, so I'm including as images.:
4: The next time I tried to drag and element, it looked to complete the second failed drag and drop (even though as per previous comments the element had clearly moved): I hope this helps. Thanks, Ian |
So to sum this up it seams like the events (and also the logs) are replayed at a later point in time but only if the drag operation is started with a |
I've recently received a major update to Android on my Pixel 1... Android version: 8.1 Just to confirm, I'm still experiencing this issue. Hopefully the Chromium devs may be able to shed some light on the problem. Thanks for continuing to investigate. |
Yesterday at work had a touch panel device running android 4.4.2 with Firefox Nightly (v59.0a1) and it showed the same behaviour that you are describing! Didn't have time to dig deeper but having a device that exhibits the behaviour might help me to get to the root of this! |
Hi,
I've recently implemented this shim into a React project of mine to provide drag and drop support for mobile devices. I was able to get this up and running pretty quickly and it worked great in simulation mode on desktop. However I was noticing some issues when testing on a physical device.
I hooked up the device to Chrome dev tools for some remote debugging and noted that the dragend event was not always being fired upon release. When you touch the screen again, it seems that the item you've just dropped reattaches to your finger position - when dropped a second time, the event fires. It doesn't seem to make any difference if you drop the element on a valid drop zone (fires drop event) or not (cancelled).
To eliminate the React layer from the problem, I stripped the code right back and created a pretty straightforward Codepen with just my drag and drop code. This contains a scroll-able div so you can drag an item, scrolling the div before dropping in one of two available drop zones.
https://codepen.io/ianovenden/pen/WZEgmg
The issue still exists. If you open the pen in full window mode full window it works fine on desktop and in simulation mode - I've added a rudimentary console to output the "DRAG END" text if the event fires (this clears after 2 seconds). However, if you open the same pen full screen in Chrome the dragend event fires intermittently. It works fine in mobile Firefox.
Issue on:
Device: Google Pixel
Chrome version: 61.0.3163.98
Android version: 8.0.0
Works as expected on:
Device: Google Pixel
Firefox version: 56.0
Android version: 8.0.0
Device: Nexus 7
Chrome version: 61.0.3163.98
Android version: 6.0.1
Appreciate your work 👍
The text was updated successfully, but these errors were encountered: