{ "id": "173500", "key": "TIMOB-26996", "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": "20432", "name": "Release 8.0.1", "archived": false, "released": true, "releaseDate": "2019-05-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2019-04-29T13:20:17.000+0000", "created": "2019-04-26T00:38:24.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TabGroup", "android", "close", "engSchedule", "window" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-04-29T13:20:17.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\nOn Android, a {{Ti.UI.Window}} or {{Ti.UI.TabGroup}} object's {{close()}} method call is ignored if it hasn't finished opening yet. The {{Window}} or {{TabGroup}} will remain open and not automatically close itself.\r\n\r\nThis means the following won't close the window. The window will remain open.\r\n{code:javascript}\r\nvar window = Ti.UI.createWindow();\r\nwindow.open();\r\nwindow.close(); // <- This method call will be ignored.\r\n{code}\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below code on Android.\r\n# Tap on the \"Open/Close Window\" button.\r\n# Notice a red window is displayed. (This is a bug. The {{close()}} method was ignored.)\r\n# Press the Android \"Back\" button.\r\n# Tap on the \"Open/Close TabGroup\" button.\r\n# Notice a red tab group is displayed. (This is a bug. The {{close()}} method was ignored.)\r\n\r\n{code:javascript}\r\nvar parentWindow = Ti.UI.createWindow();\r\nvar openWindowButton = Ti.UI.createButton({\r\n\ttitle: \"Open/Close Window\",\r\n\ttop: \"30%\",\r\n});\r\nopenWindowButton.addEventListener(\"click\", function() {\r\n\tvar childWindow = Ti.UI.createWindow({ backgroundColor: \"red\" });\r\n\tchildWindow.add(Ti.UI.createLabel({\r\n\t\ttext: \"Uh-oh!\",\r\n\t\tcolor: \"white\",\r\n\t}));\r\n\tchildWindow.open();\r\n\tchildWindow.close(); // <- This method call will be ignored.\r\n});\r\nparentWindow.add(openWindowButton);\r\nvar openTabGroupButton = Ti.UI.createButton({\r\n\ttitle: \"Open/Close TabGroup\",\r\n\ttop: \"50%\"\r\n});\r\nopenTabGroupButton.addEventListener(\"click\", function() {\r\n\tfunction createTab(title) {\r\n\t\tvar window = Ti.UI.createWindow({ title: title, backgroundColor: \"red\" });\r\n\t\twindow.add(Ti.UI.createLabel({ text: \"Uh-oh!\", color: \"white\" }));\r\n\t\tvar tab = Ti.UI.createTab({\r\n\t\t\ttitle: title,\r\n\t\t\twindow: window,\r\n\t\t});\r\n\t\treturn tab;\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\ttabGroup.open();\r\n\ttabGroup.close(); // <- This method call will be ignored or crash in older versions.\r\n});\r\nparentWindow.add(openTabGroupButton);\r\nparentWindow.open();\r\n{code}\r\n\r\n*Note:*\r\nFor {{TabGroup}}, calling the {{close()}} method will crash if the app was built with Titanium 7.x.x or older versions. In Titanium 8.0.0, it does not crash and the method call is ignored.\r\n\r\n*Expected Result:*\r\nThe {{close()}} method call should be respected, eve before the window has finished opening. This is how it works on iOS. The only time {{close()}} should be ignored is if the window has never been opened or has already been closed.\r\n\r\n*Work-around:*\r\nDon't call the {{close()}} method until the \"open\" event has been fired.\r\n", "attachment": [], "flagged": false, "summary": "Android: Window/TabGroup close() method call is ignored until \"open\" event has been fired", "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, "closedSprints": [ { "id": 1128, "state": "closed", "name": "2019 Sprint 9", "startDate": "2019-04-14T19:05:00.000Z", "endDate": "2019-04-26T19:05:00.000Z", "completeDate": "2019-04-26T22:05:13.933Z", "originBoardId": 114 }, { "id": 1129, "state": "closed", "name": "2019 Sprint 10", "startDate": "2019-04-28T22:06:00.000Z", "endDate": "2019-05-17T22:06:00.000Z", "completeDate": "2019-05-20T16:48:42.522Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "447969", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/10829", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T04:32:48.000+0000", "updated": "2019-04-26T04:32:48.000+0000" }, { "id": "448000", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (8.0.x): https://github.com/appcelerator/titanium_mobile/pull/10868", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T22:32:37.000+0000", "updated": "2019-04-26T22:32:37.000+0000" }, { "id": "448010", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR passed PR merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-26T23:19:30.000+0000", "updated": "2019-04-26T23:19:30.000+0000" }, { "id": "448033", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket, fix verified in SDK version {{8.0.1.v20190426162041}} and SDK version {{8.1.0.v20190426222341}}\r\n\r\nTest and other information can be found at: \r\nMaster : https://github.com/appcelerator/titanium_mobile/pull/10829\r\n8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10868", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-04-29T13:20:06.000+0000", "updated": "2019-04-29T13:20:06.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }