Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13759] MobileWeb: Set useTouch to false when window.ontouchscreen is set to null

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2013-05-07T04:36:17.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMichael Xia
AssigneeChris Barber
Created2013-05-06T05:23:08.000+0000
Updated2014-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.

Comments

  1. Chris Barber 2013-05-07

    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.

JSON Source