googlearchive / polymer-gestures

84 stars 27 forks source link

isEventSimulatedFromTouch should use browser API when present #97

Open RByers opened 8 years ago

RByers commented 8 years ago

The isEventSimulatedFromTouch function uses a heuristic that should usually work, but may not always. There's finally an API for this: UIEvent.source capabilities.firesTouchEvents. Currently Chrome only.

See this article and the spec. My polyfill does something a little different from your 'isEventSimulatedFromTouch' function, if you've found your position-based approach to be better then I should update the polyfill.