{ "id": "93722", "key": "TIMOB-9738", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-06-23T15:16:40.000+0000", "created": "2012-06-22T23:54:55.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "13271", "description": "Release 2.1.0", "name": "Release 2.1.0", "archived": false, "released": true, "releaseDate": "2012-06-29" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2014-06-19T12:44:36.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": "11500", "name": "MobileWeb", "description": "Mobile Web (HTML) Platform" } ], "description": "h3. Problem description\r\n'focus' event on tabGroup it's triggered also when opening a child window when using an activity indicator\r\n\r\nh3. Steps to reproduce\r\nRun the sample code.\r\n'focus' event it's correctly triggered when opening the tabGroup.\r\nThen click on the 'Child window'. activity indicator should appear. Then, when also win2 it's opened, the focus event on the tabGroup it's triggered again.\r\nOn iOS only the first event it's triggered. Also on MobileWeb it's correctly being triggered only the first one if we just remove the activity indicator.\r\n\r\n{code}\r\nvar tg = Ti.UI.createTabGroup();\r\nTi.UI.backgroundColor = 'white';\r\n\r\nvar win1 = Ti.UI.createWindow({\r\n backgroundColor: 'blue'\r\n});\r\nvar clikButton = Titanium.UI.createButton({\r\n\t\t\t\ttitle:'Child window',\r\n\t\t\t\tbackgroundImage : 'none',\r\n\t\t\t\tbackgroundColor: 'black',\r\n\t\t\t\ttop : 15,\r\n\t\t\t\theight:41,\r\n\t\t\t\tfont: {\r\n\t\t\t\t\tfontFamily:'Helvetica Neue',\r\n\t\t\t\t\tfontWeight:'bold',\r\n\t\t\t\t\tfontSize:19\r\n\t\t\t\t},\r\n\t\t\t\tcolor: '#FFFFFF'\r\n\t\t\t});\r\nwin1.add(clikButton);\r\n\r\nvar win2 = Ti.UI.createWindow({\r\n backgroundColor: 'yellow',\r\n fullscreen: false\r\n});\r\n\r\n var activityIndicator = Titanium.UI.createActivityIndicator({\r\n height:'100%',\r\n width:'100%',\r\n message:'Loading...',\r\n font:{size:8},\r\n color:'white',\r\n style:''\r\n });\r\n var activityView = Ti.UI.createView({\r\n zIndex:10,\r\n height:'20%',\r\n width:'31.25%',\r\n borderRadius:10,\r\n backgroundColor:'black'\r\n });\r\n var activityWindow = Ti.UI.createWindow({\r\n \t\t\twidth:'100%',\r\n \t\t\theight:'100%'\r\n \t\t});\r\n activityView.add(activityIndicator);\r\n activityWindow.add(activityView);\r\n\r\nclikButton.addEventListener('click', function () {\r\n activityIndicator.show();\r\n activityWindow.open();\r\n // do some work that takes 1 second\r\n setTimeout(function(){\r\n tab1.open(win2);\r\n activityIndicator.hide();\r\n activityWindow.close();\r\n }, 1000);\r\n});\r\n\r\n\r\nvar tab1 = Ti.UI.createTab({\r\n\ttitle: 'tab1',\r\n\twindow:win1\r\n});\r\ntg.addTab(tab1);\r\n\r\ntab1.addEventListener('focus',function(){\r\n\tvar alertDialogue = Ti.UI.createAlertDialog({\r\n\t\ttitle:'alert'\r\n\t});\r\n\talertDialogue.show();\r\n});\r\n\r\ntg.open();\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "MobileWeb: 'focus' tabGroup event it's triggered when opening a child window when using an activity indicator", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 2.1.0.v20120622112257\r\nTested on Chrome, Firefox and Safari", "comment": { "comments": [ { "id": "199943", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "This is correct behavior because your example is opening the \"activityWindow\" which blurs the TabGroup.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2012-06-23T15:16:40.000+0000", "updated": "2012-06-23T15:16:40.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }