CalenStyle
CalenStyle copied to clipboard
False touchscreen detection
Touchscreen detection won't work properly on all devices. For example in Windows 7 using Google Chrome 53. On a laptop with no touchscreen, it detects touch support.
In src/calenstyle.js row 469 there is a detection that returns true while it should return false:
469 : sClickHandlerButtons: ("ontouchstart" in document.documentElement ? "touchstart" : "click"),
The result is that the buttons won't work. A quick fix could be to always use "click". It looks like this was understood before if I look at line 468 that always returns "click":
468: sClickHandler: ("ontouchstart" in document.documentElement ? "click" : "click"),
The only question I have is what to do with line 467, since there is not a reliable way to detect a touch device, but this variable (bTouchDevice) is in use in a lot of code lines in this script.
467: bTouchDevice: ("ontouchstart" in document.documentElement ? true : false),
Any suggestions?
Thank you for reporting issue! The condition on line 469 is added for mobile devices, as click was causing delay in performing action, so it should not be changed before performing cross-browser testing. I will find an alternative and get back to you.