4 ms·
The author is intentionally limiting this app to touch-only for touch-capable users. This breaks the game for anyone wanting to use a touchpad or mouse on their
by Sephr 12y ago
The author is intentionally limiting this app to touch-only for touch-capable users. This breaks the game for anyone wanting to use a touchpad or mouse on their touchscreen laptop.
The offending code (from http://gameaboutsquares.com/game.c.js http://gameaboutsquares.com/game.c.js, beautified):
(function($) {
try {
document.createEvent("TouchEvent");
return;
} catch (f) {}
var eventMap = {
mousedown : "touchstart",
mouseup : "touchend",
mousemove : "touchmove"
};
// mouse handling code follows
Never do this! Remove the entire try-catch block. There is absolutely no reason for you to be limiting touch-capable users to touch-only.
- gegenschall 12y agoFurther more it is completely unusable on some touch devices, I tried iPad 4 and iPhone 5. They both scroll the page (better: bump to the top, as if you wanted to scroll past the end of a page) instead of moving the blocks. :-/
- izietto 12y agoNo problem on Android Browser 4.4
- gk1 12y agoI use a touch-enabled laptop and come across this far too often. Even nytimes.com is guilty of this, as is Stripe Checkout.
- agmetcalf 12y agoWe actually changed this recently in Stripe Checkout. Touch detection worked great for 99% of cases, but serving a touch-only experience to devices like yours was pretty clearly unacceptable. We're now treating the touch-only versions as optimized for specific platforms. For example, we have a mobile version that is optimized for, and only displays on, Android and iOS. Going forward, we may explore a pointer event polyfill to improve support for less common touch devices.
- gk1 12y agoI stand corrected. Thank you for finally making this change... It's been driving me mad.
- Kiro 12y agoWhy are people doing this? There must be a reason.
- skeletonjelly 12y agohttp://stackoverflow.com/questions/12566306/how-to-test-for-touch-events-now-that-chrome-fails-standard-tests http://stackoverflow.com/questions/12566306/how-to-test-for-...
- Kiro 12y agoIt doesn't answer why they want to do this in the first place.
- deleted 12y ago[deleted]
- JoshTriplett 12y agoI have a touchscreen laptop, and both touch and mouse work perfectly for me. Firefox 31 here.
- Aardwolf 12y agoIs it multitouch? Could it be that there is no TouchEvent and the touch screen acts as mouse?