{ "id": "132644", "key": "TIMOB-17367", "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": [ { "id": "16593", "description": "Release 4.0.0", "name": "Release 4.0.0", "archived": false, "released": true, "releaseDate": "2015-05-21" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-02-20T18:57:39.000+0000", "created": "2014-07-06T14:00:28.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "3.3.0", "ios", "leftNavButton", "qe-4.0.0", "rightNavButton" ], "versions": [], "issuelinks": [ { "id": "45443", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "143975", "key": "AC-1698", "fields": { "summary": "Weird Click Event Inconsistency with 3.5.0GA and Appcelerator NavigationWindow and RightNavButtons", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "47014", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "145495", "key": "TIMOB-18663", "fields": { "summary": "With 3.5.0.GA, can't open child window more than two times in a row", "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": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2015-04-02T17:44:14.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": "Try code below. The events work twice and then no longer function.\r\nindex.xml:\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nindex.js:\r\n{code}\r\nvar leftNav1 = Ti.UI.createLabel({\r\n\ttext: 'tch',\r\n\theight: 30,\r\n\twidth: Ti.UI.SIZE\r\n});\r\nleftNav1.addEventListener('touchstart', function() {\r\n\talert ('left touch');\r\n});\r\n\r\nvar leftNav2 = Ti.UI.createLabel({\r\n\ttext: 'clk',\r\n\theight: 30,\r\n\twidth: Ti.UI.SIZE\r\n});\r\nleftNav2.addEventListener('click', function() {\r\n\talert ('click left');\r\n});\r\n\r\n$.win1.leftNavButtons = [leftNav1, leftNav2];\r\n\r\nvar rightNav1 = Ti.UI.createLabel({\r\n\ttext: 'tch',\r\n\theight: 30,\r\n\twidth: Ti.UI.SIZE\r\n});\r\nrightNav1.addEventListener('touchstart', function() {\r\n\talert ('right touch');\r\n});\r\n\r\nvar rightNav2 = Ti.UI.createLabel({\r\n\ttext: 'clk',\r\n\theight: 30,\r\n\twidth: Ti.UI.SIZE\r\n});\r\nrightNav2.addEventListener('click', function() {\r\n\talert ('right click');\r\n});\r\n\r\n$.win1.rightNavButtons = [rightNav1, rightNav2];\r\n\r\n$.index.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: rightNavButtons and leftNavButtons touch events don't work", "creator": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "environment": "iOS SDK 3.3.0.v20140703093313", "closedSprints": [ { "id": 345, "state": "closed", "name": "2015 Sprint 04 SDK", "startDate": "2015-02-14T01:00:53.297Z", "endDate": "2015-03-01T01:00:00.000Z", "completeDate": "2015-02-28T15:39:43.652Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "312489", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Tested with regular app for rightNavButtons and leftNavButtons, they all work well. So this problem only happens in Alloy project.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-07T04:36:15.000+0000", "updated": "2014-07-07T04:36:15.000+0000" }, { "id": "312494", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "FYI - the Alloy version for me is 1.4.0-rc4 (also fails with 1.3.1), and indeed it fails with the XML above. Very strange as the affected elements are not even in the XML (thus I'm not sure the root cause is inside Alloy).\r\n\r\nThe Classic version below works fine for me:\r\n{code}\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win1 = Titanium.UI.createWindow({ \r\n title:'Tab 1',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab1 = Titanium.UI.createTab({ \r\n icon:'KS_nav_views.png',\r\n title:'Tab 1',\r\n window:win1\r\n});\r\n\r\nvar win2 = Titanium.UI.createWindow({ \r\n title:'Tab 2',\r\n backgroundColor:'#fff'\r\n});\r\nvar tab2 = Titanium.UI.createTab({ \r\n icon:'KS_nav_ui.png',\r\n title:'Tab 2',\r\n window:win2\r\n});\r\n\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\nvar leftNav1 = Ti.UI.createLabel({\r\n text: 'tch',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\nleftNav1.addEventListener('touchstart', function() {\r\n alert ('left touch');\r\n});\r\n \r\nvar leftNav2 = Ti.UI.createLabel({\r\n text: 'clk',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\nleftNav2.addEventListener('click', function() {\r\n alert ('click left');\r\n});\r\n \r\nwin1.leftNavButtons = [leftNav1, leftNav2];\r\n \r\nvar rightNav1 = Ti.UI.createLabel({\r\n text: 'tch',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\nrightNav1.addEventListener('touchstart', function() {\r\n alert ('right touch');\r\n});\r\n \r\nvar rightNav2 = Ti.UI.createLabel({\r\n text: 'clk',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\nrightNav2.addEventListener('click', function() {\r\n alert ('right click');\r\n});\r\n \r\nwin1.rightNavButtons = [rightNav1, rightNav2];\r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-07T05:41:30.000+0000", "updated": "2014-07-07T07:13:12.000+0000" }, { "id": "312524", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "It's an object management bug of some sort. If instead of \"var rightNav1\" for example I use Alloy.Globals.rightNav1, so it cannot be garbage collected, it works correctly.\r\nThus this may have much further implications than just nav bar buttons. ", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-07T12:11:27.000+0000", "updated": "2014-07-07T12:12:43.000+0000" }, { "id": "312559", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "@Tim - how can this be scheduled for 1.5.0? This is a killer bug with no good workaround..... I'm also not convinced it's an Alloy issue - could be just that Alloy manifests it. And if it is an Alloy bug, then it could possibly occur on other elements as well, since no XML is involved here.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-07T15:46:43.000+0000", "updated": "2014-07-07T15:52:00.000+0000" }, { "id": "312563", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "[~mokesmokes] We're way past code freeze for 1.4 (and SDK 3.3.0), which is why I assigned the 1.5 fix version label. In reality, there will likely be a 1.4.1 (and 3.3.1) which would come out long before an actual 1.5. I'll bring this ticket up at our triage meeting. ", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-07-07T15:55:20.000+0000", "updated": "2014-07-07T15:55:20.000+0000" }, { "id": "312568", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "I hear ya, but this kills really basic functionality just because a project uses Alloy..... I 100% agree with the \"Critical\" label, and this seems like a critical bug.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-07T16:01:48.000+0000", "updated": "2014-07-07T16:02:01.000+0000" }, { "id": "312808", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "It's not clear to me why the touch/click events are lost after two events. I see nothing obvious in the generated code that would explain why the events work twice, then stop. Regardless, there are three workarounds:\r\n\r\n1) Define your buttons as properties of the $.win object\r\n\r\n{code}\r\n$.win1.leftNav1 = Ti.UI.createLabel({\r\n text: 'tch',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\n$.win1.leftNav1.addEventListener('touchstart', function() {\r\n alert ('left touch');\r\n});\r\n \r\n$.win1.leftNav2 = Ti.UI.createLabel({\r\n text: 'clk',\r\n height: 30,\r\n width: Ti.UI.SIZE\r\n});\r\n$.win1.leftNav2.addEventListener('click', function() {\r\n alert ('click left');\r\n});\r\n \r\n$.win1.leftNavButtons = [$.win1.leftNav1, $.win1.leftNav2];\r\n{code}\r\n\r\n2. As a variation of option 1, you can brute force add all the objects to the $.win1 object by adding this line right before your $.index.open() statement:\r\n\r\n{{_.extend($, $.win1);}}\r\n\r\n(I prefer option 1 to this sledgehammer approach.)\r\n\r\n3. Use the development version of Alloy (see the \"bleeding edge\" installation instructions at https://github.com/appcelerator/alloy/) which includes a fix for ALOY-984. That appears to not have the same problems as the code you're using.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-07-08T13:22:55.000+0000", "updated": "2014-07-08T13:22:55.000+0000" }, { "id": "312851", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Thanks Tim. I also pored over the generated code and saw nothing unusual. My hunch is that the bug is actually not an Alloy bug, but rather in the SDK, and for some reason the garbage collector kicks in earlier when running the generated code. The bleeding edge Alloy version may mask this bug, but the issue is still there, and who knows - maybe after enough events it will also stop working in the regular Titanium code? I still think this warrants a serious investigation by the team - including the SDK team.\r\nFor example - maybe the bug is here?\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIWindowProxy.m#L573\r\n(which raises another pain point - why the Titanium iOS SDK is not using Automatic Reference Counting..... that would clear a ton of bugs for sure.....)\r\nThanks again!", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-08T17:03:23.000+0000", "updated": "2014-07-08T17:03:23.000+0000" }, { "id": "312869", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "Since we have a workaround, I'm taking out of this sprint. We'll investigate more to uncover the root cause.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-07-08T18:16:12.000+0000", "updated": "2014-07-08T18:16:12.000+0000" }, { "id": "312873", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-08T18:24:11.000+0000", "updated": "2014-07-08T18:24:11.000+0000" }, { "id": "315325", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "I tried this again with the release versions: Alloy 1.4.0 and SDK 3.3.0.GA (actually tried with our dev branch, 3.4.0 also). If I do a normal \"Run on Simulator\" build, buttons stop reacting after four events. If I do a \"Debug in Simulator\" build, buttons keep on reacting (I stopped clicking after 15 clicks). I don't believe this to be an Alloy bug, but something with the SDK itself.", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2014-07-22T19:54:04.000+0000", "updated": "2014-07-22T19:54:04.000+0000" }, { "id": "315349", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "I have the same hunch as you Tim. I suspect something is being released in the SDK, when it shouldn't. Which is why when the buttons are attached to other objects (e.g. workarounds 1 & 2 above) the bug doesn't occur.", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2014-07-22T21:15:23.000+0000", "updated": "2014-07-22T21:15:44.000+0000" }, { "id": "341630", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2015-02-02T16:52:16.000+0000", "updated": "2015-02-02T16:52:16.000+0000" }, { "id": "343851", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/6651", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-02-18T23:29:08.000+0000", "updated": "2015-02-18T23:29:08.000+0000" }, { "id": "343944", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "new PR: https://github.com/appcelerator/titanium_mobile/pull/6654", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-02-19T20:43:49.000+0000", "updated": "2015-02-19T20:43:49.000+0000" }, { "id": "344004", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2015-02-20T06:12:43.000+0000", "updated": "2015-02-20T06:12:43.000+0000" }, { "id": "345207", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nTitanium SDK 4.0.0.v20150303161012\r\nStudio 4.0.0.201502171827\r\nCLI 3.4.2-rc4\r\nXcode 6.2b5\r\n\r\nBoth click and touch events are firing.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-03-05T21:11:27.000+0000", "updated": "2015-03-05T21:11:27.000+0000" } ], "maxResults": 22, "total": 22, "startAt": 0 } } }