HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 528 forks source link

Check for mouse events also on touch devices #295

Open clopez opened 9 years ago

clopez commented 9 years ago

Even if a device has touch capabilities (most modern laptops have) the user can still be using the device with a mouse. So install the mouse handler events also for touch-capable devices.

More info: https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/

cesutherland commented 9 years ago

@clopez thanks for the reference! This relates to #271 and several other issues.

The issue is, for all touch devices, having both sets of event handlers will trigger the handlers multiple times (per single event). The reference you suggest mentions e.preventDefault to stop propagation of the synthetic click events. Do you know if this actually works? And if it also works for the mouse events?

I don't have a touch + mouse device, but it might be possible for me to debug this myself using chrome's simulated touch events.