{ "id": "173896", "key": "TIMOB-27254", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2019-07-18T13:11:22.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [ { "id": "20791", "name": "Release 8.0.2", "archived": false, "released": true, "releaseDate": "2019-06-18" }, { "id": "20412", "name": "Release 8.1.0", "archived": false, "released": true, "releaseDate": "2019-08-13" } ], "issuelinks": [ { "id": "57744", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "99699", "key": "TIMOB-10584", "fields": { "summary": "Android: WebView click event is not being fired", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2019-07-18T19:16:48.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Webview click event is not being fired when the parent window also has a click event. (Works fine on Android).\r\n\r\n*app.js*\r\n{code:java}\r\n\tvar window = Ti.UI.createWindow();\r\n\r\n\twindow.backgroundColor = 'yellow'\r\n\r\n\twindow.addEventListener('click', function(e) {\r\n\t alert('Window clicked');\r\n\t});\r\n\tvar webView = Titanium.UI.createWebView({\r\n\t top: 30\r\n\t});\r\n\tvar html = '' + '' + '
' + '
' + '
' + '
' + '
' + '
' + ' This is some text!' + '' + '';\r\n\twebView.html = html;\r\n\twebView.addEventListener('click', function(e) {\r\n\t alert('WebView Clicked');\r\n\t});\r\n\r\n\twindow.add(webView);\r\n\twindow.open();\r\n{code}\r\n\r\n*Test steps*\r\n# Create a titanium application with the above test case\r\n# Run the program \r\n# Tap on \"click me\" label.\r\n\r\n*Expected result*\r\nThree alerts appear on screen with messages \"123456\",\"WebView Clicked\" and \"Window clicked\". \r\n\r\n*Actual result*\r\nOnly one alert can be seen, \"WebView Clicked\". ", "attachment": [], "flagged": false, "summary": "[iOS] WebView click event is not being fired", "creator": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "iPhone 6s 12.2\r\nAndroid pixel XL 7.1.1. Emulator \r\nMacOS Mojave version 10.14.4\r\nXcode 11 Beta 3\r\nNode.js ^8.12.0\r\n\"NPM\":\"4.2.13\",\"CLI\":\"7.1.0-master.24\"\r\nSDK 8.0.2.GA \r\nSDK 8.1.0.v20190716120350", "comment": { "comments": [ { "id": "449927", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~smohammed]\r\n1. In iOS implementation is in such a way that you can show only one alert at a time. So it is showing only one alert. I have modified your test case, replaced alert with log message. Now I can see the log for window click event and WebView click event. \r\n2. As for as event of javascript is concerned, it is limitation in iOS. If you want javascript event get fired, you have to use [willHandleTouches|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.WebView-property-willHandleTouches]. \r\n\r\nSee following note in doc for detail-\r\n{code:java}\r\niOS Platform Implementation Notes\r\nOn the iOS platform, the native web view handles scrolling and other related touch events internally. If you add event listeners on the web view or its parent views for any of the standard touch events (touchstart, click, and so on), these events do not reach the native web view, and the user will not be able to scroll, zoom, click on links, and so on. To prevent this default behavior, set willHandleTouches to false.\r\n\r\nIn other words, you can have either Titanium-style events against the web view instance, or internal JavaScript events in the DOM, but not both.\r\n{code}\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-07-18T19:16:48.000+0000", "updated": "2019-07-18T19:16:48.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }