dragend icon indicating copy to clipboard operation
dragend copied to clipboard

Dragend stopped working on desktop browsers (Chrome 39.0.2171.95 and Firefox)

Open ndkv opened this issue 10 years ago • 3 comments
trafficstars

Dragend doesn't work on Chrome anymore.

It seems that the isTouch = 'ontouchstart' in win check on line 100 isn't valid anymore. ontouchstart is present in win (but has a value of null) hence isTouch always evaluates to true. This breaks swiping on desktop browsers as mouse events are not handled anymore.

This was already the case with Firefox (see my brief investigation in issue #46) but is now also happening on Chrome. Last week everything worked fine on Chrome (desktop) as it didn't have an ontouchstart property in win and the check on line 100 returned false.

Oddly enough, mobile browsers also report that ontouchstart is null so I wouldn't know how to differentiate between desktop and mobile without using a full-fledged browser detection library. Any thoughts?

ndkv avatar Dec 31 '14 13:12 ndkv

Hey @ndkv, thanks for the investigation. Since null is a falsy value - would changing it to win.ontouchstart help?

Stereobit avatar Jan 01 '15 17:01 Stereobit

I don't think so as ontouchstart is also null on mobile browsers. Simply checking its value will break dragend on them.

Detecting touch is a messy business (see this Stackoverflow question).

Seeing that these things apparently change overnight, I think the best strategy is to include a custom build of e.g. Modernizr to check for touch capabilities. Sadly that isn't a robust solution either.

Another option is to implement both at the same time as mentioned here and here.

ndkv avatar Jan 02 '15 10:01 ndkv

Thinking of using this lib, but this issue makes me hesitant. Any progress?

0xgeert avatar Feb 25 '15 07:02 0xgeert