dragend
dragend copied to clipboard
Dragend stopped working on desktop browsers (Chrome 39.0.2171.95 and Firefox)
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?
Hey @ndkv, thanks for the investigation. Since null is a falsy value - would changing it to win.ontouchstart help?
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.
Thinking of using this lib, but this issue makes me hesitant. Any progress?