{ "id": "140387", "key": "TIMOB-18075", "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": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" }, { "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": "2014-12-03T21:24:57.000+0000", "created": "2014-11-24T08:19:47.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Regression", "module_window", "qe-3.5.0", "qe-manualtest" ], "versions": [ { "id": "16704", "description": "Release 3.5.0", "name": "Release 3.5.0", "archived": false, "released": true, "releaseDate": "2015-01-13" } ], "issuelinks": [ { "id": "43325", "type": { "id": "10122", "name": "Gantt: start-finish", "inward": "is triggered by", "outward": "is triggering" }, "inwardIssue": { "id": "91286", "key": "TIMOB-8976", "fields": { "summary": "Android: window focus event it's not triggered when going back to the parent window", "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": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2014-12-09T23:40:55.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": "Window *Focus* Event is not triggered when we switch between tabs in iOS device. \r\nFor Android, It works fine.\r\n\r\nThis is a *regression* since it doesn't occur in SDK 3.4.1 GA\r\n\r\nh5. Steps To Reproduce\r\n1. Create a default titanium classic project\r\n2. Insert following code in your app.js file\r\n{code}\r\nwin1.addEventListener('focus', function(){\r\n\talert('focused!');\r\n});\r\n{code}\r\n3. Run the app in iOS device \r\n4. Switch between *tab 1* and *tab 2*\r\n\r\nh5. Expected Result\r\nAn alert should appear with text \"focused!\"\r\n\r\nh5. Actual Result\r\nAlert does not appear with SDK version 3.5.0\r\n\r\nh5. Tested app.js file\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\n\r\n//\r\n// create base UI tab and root window\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 label1 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 1',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\n\r\nwin1.add(label1);\r\nwin1.addEventListener('focus', function(){\r\n\t\t alert('focused!');\r\n\t\t});\r\n\r\n//\r\n// create controls tab and root window\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\nvar label2 = Titanium.UI.createLabel({\r\n\tcolor:'#999',\r\n\ttext:'I am Window 2',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto'\r\n});\r\nwin2.add(label2);\r\n\r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\ntabGroup.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Window focus event is not triggered when switch back from another tab", "creator": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "kvelummaylum", "key": "kvelummaylum", "displayName": "Kajenthiran Velummaylum", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Titanium SDK: 3.5.0.v20141121153314\r\nAppc-Studio: 3.4.1 GA\r\nTitanium CLI: 3.4.1 GA\r\nAlloy : 1.5.1 GA\r\nXcode : 6.1\r\nOS: OSX 10.10.1\r\nDevice : iPhone 6plus (iOS 8.1)", "closedSprints": [ { "id": 258, "state": "closed", "name": "2014 Sprint 24 SDK", "startDate": "2014-11-24T22:28:25.425Z", "endDate": "2014-12-06T01:00:00.000Z", "completeDate": "2014-12-08T17:21:15.171Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "334569", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Look for changes in Window or Tab/TabGroup.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T18:16:59.000+0000", "updated": "2014-12-03T18:16:59.000+0000" }, { "id": "334595", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This is due to the refactor of alert dialogs and option dialogs for iOS8. Since they are now UIAlertControllers presented modally, the top most window proxy resigns focus when they are presented. We need to ensure that the top most window proxy regains focus on dismissal of Alerts/OptionDialogs", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T19:15:52.000+0000", "updated": "2014-12-03T19:15:52.000+0000" }, { "id": "334596", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "The test case above will not work. It will essentially result in an infinite loop on iOS8 since presenting alerts now blurs the window and dismissing it will refocus the window causing the focus event to fire again. Updated test case below\r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n \r\n// create tab group\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n \r\n \r\n//\r\n// create base UI tab and root window\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 label1 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 1',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\n \r\nwin1.add(label1);\r\n\r\n \r\n//\r\n// create controls tab and root window\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\nvar label2 = Titanium.UI.createLabel({\r\n color:'#999',\r\n text:'I am Window 2',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\nwin2.add(label2);\r\n \r\ntabGroup.addTab(tab1); \r\ntabGroup.addTab(tab2); \r\n\r\nvar lastFocus = null;\r\n\r\nwin1.addEventListener('focus', function(){\r\n\t//Ti.API.info('WIN1 FOCUS');\r\n\tif(lastFocus != win1) {\r\n\t\tlastFocus = win1;\r\n\t\talert('WIN1 Focus');\r\n\t}\r\n});\r\n\r\nwin2.addEventListener('focus', function(){\r\n\t//Ti.API.info('WIN2 FOCUS');\r\n\tif(lastFocus != win2) {\r\n\t\tlastFocus = win2;\r\n\t\talert('WIN2 Focus');\r\n\t}\r\n});\r\n \r\ntabGroup.open();\r\n{code}", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T19:17:16.000+0000", "updated": "2014-12-03T19:17:16.000+0000" }, { "id": "334599", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending\r\nmaster - https://github.com/appcelerator/titanium_mobile/pull/6417\r\n3_5_X - https://github.com/appcelerator/titanium_mobile/pull/6418", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-03T19:19:36.000+0000", "updated": "2014-12-03T19:31:54.000+0000" }, { "id": "335742", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified (using Vishal's test code) focus event is triggered when switching between tabs.\r\n\r\nAppcelerator Studio, build: 3.4.1.201410281743\r\nSDK build: 3.5.0.v20141208122514 \r\nCLI: 3.4.1\r\nAlloy: 1.5.1\r\nXcode: 6.1.1 GM \r\nDevices: iphone 6 plus (8.1.1), ipad air (8.2 beta)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-12-09T23:39:51.000+0000", "updated": "2014-12-09T23:39:51.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }