[TIMOB-13759] MobileWeb: Set useTouch to false when window.ontouchscreen is set to null
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2013-05-07T04:36:17.000+0000 |
Affected Version/s | Release 3.1.0 |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Michael Xia |
Assignee | Chris Barber |
Created | 2013-05-06T05:23:08.000+0000 |
Updated | 2014-01-28T23:23:13.000+0000 |
Description
We are seeing an issue with Denso IVI platform where for Titanium apps, the click event is not being handled on IVI browser. After investigation from the Denso team, it looks to be caused by the QtWebKit implementation of window.ontouchstart property handling.
In QtWebKit, it set "window.ontouchscreen = null" even though it doesn't support touch event. However, in our mobile web code, we only check for the existence of ontouchscreen property and assume the browser supports touch event as long as it is set, even if it's set to null. Since QtWebKit only reports mouse event, as a result, no one responds to click events.
The Denso team is able to work around the issue by modifying the code in files mobileweb/titanium/Ti/_/UI/Element.js and mobileweb/titanium/Ti/UI.js to add the following line after "useTouch = 'ontouchstart' in global":
if (useTouch && global.ontouchstart == null) {
useTouch = false;
}
This ticket is to merge the suggested change into the mobile web code.
We cannot do this because on iOS devices, "ontouchstart" in window == true and window.ontouchstart == null, so this logic would always set useTouch to false on iOS devices.