{ "id": "163272", "key": "TIMOB-23954", "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": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2017-01-03T12:39:34.000+0000", "created": "2016-09-17T20:15:25.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "ios", "run-on-main-thread" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" }, { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [ { "id": "53873", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "162770", "key": "TIMOB-23810", "fields": { "summary": "iOS: Delay in firing click event listener on View when using run-on-main-thread", "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": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T21:59:27.000+0000", "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" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When creating views using Alloy or Classic code of Appcelerator API dynamically and adding those views to the window or view created in other controller, which has event associated with it; the event with the parent view does not get fired when clicked on the child view. Please look into the sample app with this link:\r\n[https://www.dropbox.com/s/3x82na9nqt7l3oa/SampleApp.zip?dl=0]\r\n\r\nAppcelerator SDK: 5.4.0.GA/5.5.0.GA\r\n\r\n*Workaround*: Disable {{run-on-main-thread}} temporary.", "attachment": [], "flagged": false, "summary": "iOS: Events not firing from the child view if created dynamically (using run-on-mainthread)", "creator": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "subtasks": [], "reporter": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "environment": null, "comment": { "comments": [ { "id": "396460", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "You are adding child-views to the container and have the click-listener on the container - which never gets clicked because you click on the children, not the container. So you should rather make the click-listener on each view and delegate the event through a callback to your index-controller.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-18T13:50:57.000+0000", "updated": "2016-09-18T13:51:23.000+0000" }, { "id": "396474", "author": { "name": "nkumar89", "key": "nkumar89", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "body": "Hi Hans,\r\n\r\nThank you for the reply. I have tried the same code using Appcelerator SDK 5.3.1.GA and earlier and that is working fine. I hope to get the same response from the later SDKs too. Also, in 5.4.0.GA, if we try by adding labels only, it works fine. The problem is with the adding views dynamically only.", "updateAuthor": { "name": "nkumar89", "key": "nkumar89", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "created": "2016-09-19T05:32:36.000+0000", "updated": "2016-09-19T05:35:25.000+0000" }, { "id": "397391", "author": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "body": "Should I expect to get the solution now?", "updateAuthor": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "created": "2016-09-27T15:28:09.000+0000", "updated": "2016-09-27T15:28:09.000+0000" }, { "id": "397397", "author": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "body": "@Hans: Thanks for the reply. Can you please help me to know where can I get the patch from?", "updateAuthor": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "created": "2016-09-27T15:35:46.000+0000", "updated": "2016-09-27T15:35:46.000+0000" }, { "id": "397398", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can you see a different behavior when having {{run-on-main-thread}} enabled/disabled? it might be relate to TIMOB-23934 which was fixed on master yesterday.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-27T15:35:59.000+0000", "updated": "2016-09-27T15:35:59.000+0000" }, { "id": "397400", "author": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "body": "When I set the value for {code:java} run-on-main-thread {code}\r\n to true, it does not work as expected. But making it false works fine.\r\nThanks a lot.", "updateAuthor": { "name": "nkumar_tacme", "key": "nkumar_tacme", "displayName": "Niraj Kumar", "active": true, "timeZone": "Asia/Dubai" }, "created": "2016-09-27T15:41:47.000+0000", "updated": "2016-09-27T15:41:47.000+0000" }, { "id": "397405", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Test-case:\r\n{code:javascript}\r\nvar index = Ti.UI.createWindow({\r\n layout: \"vertical\",\r\n backgroundColor: \"white\",\r\n});\r\nvar viewContainer = Ti.UI.createView({\r\n layout: \"vertical\",\r\n backgroundColor: \"white\",\r\n});\r\n\r\nindex.add(viewContainer);\r\n\r\n// Should also be triggered by it's childs\r\nindex.addEventListener(\"click\", function(e) {\r\n alert(\"clicked!\");\r\n});\r\n\r\nfor (var i = 0; i < 10; i++) {\r\n var view = Ti.UI.createView({\r\n height: 40,\r\n backgroundColor: \"red\"\r\n });\r\n view.add(Ti.UI.createLabel({\r\n text: \"Label \" + i\r\n }));\r\n viewContainer.add(view);\r\n}\r\n\r\nindex.open();\r\n{code}\r\n\r\nAs suspected, it works with {{run-on-main-thread}} disabled, but is no duplicate of TIMOB-23934. Moved to TIMOB for further investigation!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-27T16:39:01.000+0000", "updated": "2016-09-27T16:39:01.000+0000" }, { "id": "397408", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Also interesting: The bubbled click-event from \"index\" to \"viewContainer\" works, but the children of \"viewContainer\" don't.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-27T16:46:13.000+0000", "updated": "2016-09-27T16:46:13.000+0000" }, { "id": "403499", "author": { "name": "engross", "key": "engross", "displayName": "Dongwoo Gim", "active": true, "timeZone": "Asia/Seoul" }, "body": "Is this going on?", "updateAuthor": { "name": "engross", "key": "engross", "displayName": "Dongwoo Gim", "active": true, "timeZone": "Asia/Seoul" }, "created": "2016-12-16T12:14:15.000+0000", "updated": "2016-12-16T12:14:15.000+0000" }, { "id": "403978", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Resolving as Duplicate of TIMOB-23810 for further investigation by [~vijaysingh]!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-03T12:39:34.000+0000", "updated": "2017-01-03T12:39:34.000+0000" }, { "id": "415068", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate and links to the related ticket has been provided above.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T21:59:27.000+0000", "updated": "2017-03-22T21:59:27.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }