scottohara / tvmanager

PWA for tracking recorded, watched & upcoming TV shows
MIT License
3 stars 0 forks source link

SpinningWheel no longer working on desktop (Chrome) #21

Closed scottohara closed 10 years ago

scottohara commented 12 years ago

Seemed to occur around the time of the iScroll removal?

scottohara commented 10 years ago

The issue is that our TouchEventProxy object tests to see if we're running in a browser that supports touch events using the following check:

try {
  var testEvent = document.createEvent('TouchEvent');
} catch {
  // must be a desktop browser..map mouse events to touch events
}

Recent versions of Chrome no longer throw an exception when trying to create a TouchEvent; so the mouse events aren't being mapped.

The problem is that what Chrome does is actually correct: The Chome browser now supports touch events (eg. for PCs with both a mouse and a touch screen); but we're not using a device with a touch screen.

The correct solution is to use the upcoming PointerEvents API (currently only supported in IE10+); which is an abstraction of all pointing device inputs (mouse or touch).

Once Chrome adds support for pointer events, any code that relies on TouchEvents (SpinningWheel, ABC) should be changed to use the corresponding PointerEvents; and then we can deprecate the TouchEventProxy object entirely.