{ "id": "173697", "key": "TIMOB-27118", "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": "20832", "name": "Release 8.3.0", "archived": false, "released": true, "releaseDate": "2019-11-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-09-10T05:06:07.000+0000", "created": "2019-06-01T02:53:55.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "TabGroup", "android", "close", "engSchedule", "event" ], "versions": [], "issuelinks": [], "assignee": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "updated": "2019-09-10T05:06:07.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "*Summary:*\r\nWhen calling a {{TabGroup}} object's {{close()}} method, that {{TabGroup}} will fire a \"close\" event twice when it shouldn't.\r\n\r\nIf you tap the Android \"Back\" button, then it will correctly fire the \"close\" event only once. This is only an issue when calling the {{close()}} method.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android.\r\n# Tap on the \"Show TabGroup\" button.\r\n# Tap on the \"Close TabGroup\" button.\r\n# Notice in the log that a {{\"TabGroup 'close'\"}} was logged twice. _(This is the bug.)_\r\n# Tap on the \"Show TabGroup\" button.\r\n# Tap on the Android \"Back\" button to close the {{TabGroup}}.\r\n# Notice in the log that {{\"TabGroup 'close'\"}} was only logged once. _(This is correct.)_\r\n\r\n{code:javascript}\r\nvar TAB_GROUP_REQUESTING_CLOSE_EVENT_NAME = \"tabGroup:requestingClose\";\r\n\r\nfunction createTab(title) {\r\n\tvar window = Ti.UI.createWindow({ title: title });\r\n\twindow.add(Ti.UI.createLabel({ text: title + \" View\" }));\r\n\tvar closeButton = Ti.UI.createButton({\r\n\t\ttitle: \"Close TabGroup\",\r\n\t\tbottom: \"20%\",\r\n\t});\r\n\tcloseButton.addEventListener(\"click\", function() {\r\n\t\tTi.App.fireEvent(TAB_GROUP_REQUESTING_CLOSE_EVENT_NAME);\r\n\t});\r\n\twindow.add(closeButton);\r\n\tvar tab = Ti.UI.createTab({\r\n\t\ttitle: title,\r\n\t\twindow: window,\r\n\t});\r\n\treturn tab;\r\n}\r\n\r\nvar parentWindow = Ti.UI.createWindow();\r\nvar showTabGroupButton = Ti.UI.createButton({ title: \"Show TabGroup\" });\r\nshowTabGroupButton.addEventListener(\"click\", function() {\r\n\tfunction onRequestingClose() {\r\n\t\ttabGroup.close();\r\n\t}\r\n\tvar tabGroup = Ti.UI.createTabGroup({\r\n\t\ttabs: [createTab(\"Tab 1\"), createTab(\"Tab 2\"), createTab(\"Tab 3\")],\r\n\t});\r\n\tif (Ti.App.iOS) {\r\n\t\ttabGroup.backgroundColor = \"white\";\r\n\t}\r\n\ttabGroup.addEventListener(\"open\", function(e) {\r\n\t\tTi.App.addEventListener(TAB_GROUP_REQUESTING_CLOSE_EVENT_NAME, onRequestingClose);\r\n\t\tTi.API.info(\"@@@ TabGroup 'open' event was fired.\");\r\n\t});\r\n\ttabGroup.addEventListener(\"close\", function(e) {\r\n\t\tTi.App.removeEventListener(TAB_GROUP_REQUESTING_CLOSE_EVENT_NAME, onRequestingClose);\r\n\t\tTi.API.info(\"@@@ TabGroup 'close' event was fired.\");\r\n\t});\r\n\ttabGroup.open();\r\n});\r\nparentWindow.add(showTabGroupButton);\r\nparentWindow.open();\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: TabGroup close() wrongly fires \"close\" event twice", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "449939", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR (master):https://github.com/appcelerator/titanium_mobile/pull/11062", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-07-19T14:18:47.000+0000", "updated": "2019-07-19T14:18:47.000+0000" }, { "id": "450191", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "FR passed. Tab group close event fired only once. works as expected.PR will be merged after 8.1.0 GA ", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-07-31T17:31:31.000+0000", "updated": "2019-07-31T17:31:31.000+0000" }, { "id": "450822", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "PR (8_3_X): https://github.com/appcelerator/titanium_mobile/pull/11175", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2019-08-26T14:12:39.000+0000", "updated": "2019-08-26T14:12:39.000+0000" }, { "id": "451225", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged master PR. Closed 8_3_X PR as that branch will be going away and master is current 8.3.0 target.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2019-09-09T18:27:18.000+0000", "updated": "2019-09-09T18:27:18.000+0000" }, { "id": "451247", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on sdk 8.3.0.v20190909144256. Tabgroup works as expected.\r\n{code}\r\nTest Environment:\r\n Name = Mac OS X\r\n Version = 10.14.5\r\n Architecture = 64bit\r\n # CPUs = 12\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 10.16.2\r\n npm Version = 6.9.0\r\nTitanium CLI\r\n CLI Version = 5.2.1\r\nTitanium SDK\r\n SDK Version = 8.3.0.v20190909144256\r\nDevice -samsung s5 android 6\r\nEmulator- pixel android 9\r\n{code}\r\n", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-09-10T05:05:52.000+0000", "updated": "2019-09-10T05:05:52.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }